From: Maximilian Albert Date: Sun, 10 Jan 2010 10:47:19 +0000 (+0000) Subject: Avoid crash by uninitialized perspectives. X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=817e7487ecbca8958844479ae421ac4b32403f0b;p=inkscape.git Avoid crash by uninitialized perspectives. --- diff --git a/src/widgets/toolbox.cpp b/src/widgets/toolbox.cpp index f014a7d70..a09e04132 100644 --- a/src/widgets/toolbox.cpp +++ b/src/widgets/toolbox.cpp @@ -3409,7 +3409,7 @@ static void box3d_toolbox_prep(SPDesktop *desktop, GtkActionGroup* mainActions, box3d_angle_x = eact; } - if (!persp3d_VP_is_finite(persp_impl, Proj::X)) { + if (!persp_impl || !persp3d_VP_is_finite(persp_impl, Proj::X)) { gtk_action_set_sensitive( GTK_ACTION(eact), TRUE ); } else { gtk_action_set_sensitive( GTK_ACTION(eact), FALSE ); @@ -3449,7 +3449,7 @@ static void box3d_toolbox_prep(SPDesktop *desktop, GtkActionGroup* mainActions, box3d_angle_y = eact; } - if (!persp3d_VP_is_finite(persp_impl, Proj::Y)) { + if (!persp_impl || !persp3d_VP_is_finite(persp_impl, Proj::Y)) { gtk_action_set_sensitive( GTK_ACTION(eact), TRUE ); } else { gtk_action_set_sensitive( GTK_ACTION(eact), FALSE ); @@ -3488,7 +3488,7 @@ static void box3d_toolbox_prep(SPDesktop *desktop, GtkActionGroup* mainActions, box3d_angle_z = eact; } - if (!persp3d_VP_is_finite(persp_impl, Proj::Z)) { + if (!persp_impl || !persp3d_VP_is_finite(persp_impl, Proj::Z)) { gtk_action_set_sensitive( GTK_ACTION(eact), TRUE ); } else { gtk_action_set_sensitive( GTK_ACTION(eact), FALSE );