History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: GLB-2
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Mikael Hallendal
Reporter: Mikael Hallendal
Votes: 0
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
GNOME Launch Box

Crash when icon is unavailable for application

Created: 08/Apr/05 10:30 AM   Updated: 13/Apr/05 09:23 PM
Component/s: None
Affects Version/s: 0.1
Fix Version/s: 0.2


 Description  « Hide
Comment from: Adam Lydick <lydickaw (at) ruffledpenguin (dot) org>
LB's icon resolving code sometimes returns null (I assume this is when a
app was not assigned an icon, but has a desktop entry). This causes a
segfault in lb_get_pixbuf_from_icon_name (lb-utils.c).

I added some null/empty checking as a quick fix. This seems to work,
because when the function returns null, LB handles it by substituting a
default "application" icon.

GdkPixbuf *
lb_get_pixbuf_from_icon_name (const gchar *icon_name)
{
GdkPixbuf *pixbuf;
gchar *tmp, *dot;
GError *error = NULL;

/* return null if we get a null or empty string */
if (icon_name == NULL || icon_name[0] == '\0')
return NULL;

/* Handle absolute paths. */
if (icon_name[0] == '/') { return gdk_pixbuf_new_from_file_at_size (icon_name, 64, 64, NULL); }
}



 All   Comments   Change History      Sort Order:
Mikael Hallendal - [13/Apr/05 09:23 PM ]
Commited suggested solution.