Code

fix 189661
authorbuliabyak <buliabyak@users.sourceforge.net>
Wed, 6 Feb 2008 20:19:45 +0000 (20:19 +0000)
committerbuliabyak <buliabyak@users.sourceforge.net>
Wed, 6 Feb 2008 20:19:45 +0000 (20:19 +0000)
src/widgets/toolbox.cpp

index fcf43728801013084ad7a27f8bcaf9b9bd7d8b24..eb4b404e8f1a0f066a328ced7f899790ead4e093 100644 (file)
@@ -5280,7 +5280,9 @@ static void sp_paintbucket_toolbox_prep(SPDesktop *desktop, GtkActionGroup* main
 
     // Create the units menu.
     UnitTracker* tracker = new UnitTracker( SP_UNIT_ABSOLUTE | SP_UNIT_DEVICE );
-    tracker->setActiveUnit(sp_unit_get_by_abbreviation(prefs_get_string_attribute("tools.paintbucket", "offsetunits")));
+    const gchar *stored_unit = prefs_get_string_attribute("tools.paintbucket", "offsetunits");
+    if (stored_unit)
+        tracker->setActiveUnit(sp_unit_get_by_abbreviation(stored_unit));
     g_object_set_data( holder, "tracker", tracker );
     {
         GtkAction* act = tracker->createAction( "PaintbucketUnitsAction", _("Units"), ("") );