Code

fix crash with empty parameter string
authorbuliabyak <buliabyak@users.sourceforge.net>
Sun, 15 Jul 2007 14:49:36 +0000 (14:49 +0000)
committerbuliabyak <buliabyak@users.sourceforge.net>
Sun, 15 Jul 2007 14:49:36 +0000 (14:49 +0000)
src/extension/parameter.cpp

index b35052a0e9039e3064c925f9674d7b80f14535b1..f59a5cc3d3823c4f020a4f641afae48e1997b85e 100644 (file)
@@ -917,6 +917,9 @@ ParamFloat::string (void)
 Glib::ustring *
 ParamString::string (void)
 {
+    if (_value == NULL)
+        return new Glib::ustring("");
+
     // FIXME: I think the string should NOT be escaped. Just put between "..."
     // Otherwise \frac{1}{2} will become \\frac{1}{2} and then the LaTeX effect won't work....
     //gchar * esc = g_strescape(_value, NULL);