fix crash when no shadow is defined for active label
authorDana Jansens <danakj@orodu.net>
Tue, 5 Jun 2007 21:32:31 +0000 (21:32 +0000)
committerDana Jansens <danakj@orodu.net>
Tue, 5 Jun 2007 21:32:31 +0000 (21:32 +0000)
render/theme.c

index 627d95f2f613dfa80c6d602c70cdaf14683b6262..ba1ce78d1f7d2eb1ddf61e593639de5656d88099 100644 (file)
@@ -874,11 +874,14 @@ RrTheme* RrThemeNew(const RrInstance *inst, const gchar *name,
             theme->a_focused_label->texture[0].data.text.shadow_offset_x;
         theme->osd_hilite_label->texture[0].data.text.shadow_offset_y =
             theme->a_focused_label->texture[0].data.text.shadow_offset_y;
-        theme->osd_shadow_color =
-            RrColorNew(inst,
-                       theme->title_focused_shadow_color->r,
-                       theme->title_focused_shadow_color->g,
-                       theme->title_focused_shadow_color->b);
+        if (theme->title_focused_shadow_color)
+            theme->osd_shadow_color =
+                RrColorNew(inst,
+                           theme->title_focused_shadow_color->r,
+                           theme->title_focused_shadow_color->g,
+                           theme->title_focused_shadow_color->b);
+        else
+            theme->osd_shadow_color = RrColorNew(inst, 0, 0, 0);
         theme->osd_shadow_alpha = theme->title_focused_shadow_alpha;
     }