After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 744353 - lua-factory: may_resolve doesn't handle media being NULL
lua-factory: may_resolve doesn't handle media being NULL
Status: RESOLVED FIXED
Product: grilo
Classification: Other
Component: lua
git master
Other Linux
: Normal normal
: ---
Assigned To: grilo-maint
grilo-maint
Depends on:
Blocks:
 
 
Reported: 2015-02-11 20:58 UTC by Sebastian Keller
Modified: 2015-02-13 11:36 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
lua-factory: Fix may_resolve with NULL media (1.11 KB, patch)
2015-02-11 20:58 UTC, Sebastian Keller
needs-work Details | Review
lua-factory: Fix may_resolve with NULL media (1.40 KB, patch)
2015-02-12 15:53 UTC, Sebastian Keller
committed Details | Review

Description Sebastian Keller 2015-02-11 20:58:05 UTC
Created attachment 296637 [details] [review]
lua-factory: Fix may_resolve with NULL media

grl_lua_factory_source_may_resolve might be called with media being NULL (via expand_operation_keys in grl-source.c for example). Currently this case is not handled properly and may_resolve calls grl_data_has_key which results in a critical warning because media is NULL. This is one of the sources of some of the critical warnings when running gnome-music.

I'm attaching a patch that handles this case by adding all required keys of the source to missing_keys since that is what seems to be what expand_operation_keys expects and what some other plugins (tmdb) seem to do as well. Some other plugins (metadata) and the example in the documentation however seem to indicate that simply returning FALSE would be enough.
Comment 1 Bastien Nocera 2015-02-12 10:53:28 UTC
Review of attachment 296637 [details] [review]:

Could you please put the explanation you gave in the bug inside the commit message? The explanation is terse.
Comment 2 Sebastian Keller 2015-02-12 15:53:04 UTC
Created attachment 296685 [details] [review]
lua-factory: Fix may_resolve with NULL media

Updated the patch, please feel free to push if ACN since I don't have a git account.
Comment 3 Bastien Nocera 2015-02-13 11:36:45 UTC
Attachment 296685 [details] pushed as 1a21bfe - lua-factory: Fix may_resolve with NULL media