Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fb.GetQueryItems(fb.GetLibraryItems(), null) #196

Open
regorxxx opened this issue Dec 25, 2022 · 1 comment
Open

fb.GetQueryItems(fb.GetLibraryItems(), null) #196

regorxxx opened this issue Dec 25, 2022 · 1 comment

Comments

@regorxxx
Copy link

Blank panel:
console.log(fb.GetQueryItems(fb.GetLibraryItems(), null))

Will return any track with "null" on title, album, etc. instead of throwing an error or returning nothing (like passing undefined)). Null should not be parsed as a string in any case.

@regorxxx
Copy link
Author

regorxxx commented Dec 25, 2022

console.log('null', fb.GetQueryItems(fb.GetLibraryItems(), null))
console.log('""', fb.GetQueryItems(fb.GetLibraryItems(), ""))
console.log('void(0)', fb.GetQueryItems(fb.GetLibraryItems(), void(0)))
console.log('{}', fb.GetQueryItems(fb.GetLibraryItems(), {}))
console.log('Boolean', fb.GetQueryItems(fb.GetLibraryItems(), true))

null FbMetadbHandleList {Count=1, ...}
"" FbMetadbHandleList {Count=0, ...}
void(0) FbMetadbHandleList {Count=0, ...}
{} FbMetadbHandleList {Count=0, ...}
Boolean FbMetadbHandleList {Count=133, ...}

Well the conversion does affect other types... boolean values being converted to string 'true'/'false', etc.

Considering the recommended practice is to wrap the GetQueryItems method with try/catch to check for invalid queries... if those use-cases don't throw, it's a call for problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant