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 682252 - Crashes if default bg not installed
Crashes if default bg not installed
Status: RESOLVED FIXED
Product: gnome-desktop
Classification: Core
Component: libgnome-desktop
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Desktop Maintainers
Desktop Maintainers
Depends on:
Blocks:
 
 
Reported: 2012-08-20 12:19 UTC by Alexander Larsson
Modified: 2012-08-20 13:59 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Fix crash if default background not found (1015 bytes, patch)
2012-08-20 12:19 UTC, Alexander Larsson
needs-work Details | Review
Fix crash if default background not found (1.01 KB, patch)
2012-08-20 13:54 UTC, Alexander Larsson
committed Details | Review

Description Alexander Larsson 2012-08-20 12:19:13 UTC
If the default bg is not installed, then the gnome_bg_load_from_preferences() call to g_settings_get_mapped() will crash with:

  if (!mapping (NULL, &result, user_data))
    g_error ("The mapping function given to g_settings_get_mapped() for key "
             "`%s' in schema `%s' returned FALSE when given a NULL value.",
             key, g_settings_schema_get_id (settings->priv->schema));
Comment 1 Alexander Larsson 2012-08-20 12:19:29 UTC
Created attachment 221824 [details] [review]
Fix crash if default background not found

Its a hard error (i.e. crash) if you return FALSE from
the final fallback in a g_settings_get_mapped map function.
Fix that by returning NULL.
Comment 2 Bastien Nocera 2012-08-20 12:57:38 UTC
(In reply to comment #1)
> Created an attachment (id=221824) [details] [review]
> Fix crash if default background not found
> 
> Its a hard error (i.e. crash) if you return FALSE from
> the final fallback in a g_settings_get_mapped map function.
> Fix that by returning NULL.

Fix that by returning TRUE...
Comment 3 Alexander Larsson 2012-08-20 13:38:17 UTC
> Fix that by returning TRUE...

Perhaps confusing, but i was refering to *result which is now NULL.
Comment 4 Alexander Larsson 2012-08-20 13:54:35 UTC
Created attachment 221845 [details] [review]
Fix crash if default background not found

Its a hard error (i.e. crash) if you return FALSE from
the final fallback in a g_settings_get_mapped map function.
Fix that by returning TRUE with a NULL result.
Comment 5 Alexander Larsson 2012-08-20 13:59:09 UTC
Attachment 221824 [details] pushed as 443f4a5 - Fix crash if default background not found
Attachment 221845 [details] pushed as 443f4a5 - Fix crash if default background not found