]> git.lyx.org Git - features.git/blobdiff - src/frontends/xforms/Toolbar_pimpl.C
Fix crash when entering unhandled math objects in toolbar
[features.git] / src / frontends / xforms / Toolbar_pimpl.C
index b13eea114ec8e6f182d6d692aa5175d11c726c4d..d9a72639bc422e168f13dd0d38e86cebf8fed3d8 100644 (file)
@@ -306,12 +306,16 @@ void setPixmap(FL_OBJECT * obj, int action, int buttonwidth, int height) {
        }
 
        if (act == LFUN_INSERT_MATH && !arg.empty()) {
-               lyxerr[Debug::GUI] << "Using mathed-provided icon" << endl;
                char const ** pixmap = get_pixmap_from_symbol(arg.c_str(),
                                                        buttonwidth,
                                                        height);
-               fl_set_pixmapbutton_data(obj, const_cast<char **>(pixmap));
-               return;
+               if (pixmap) {
+                       lyxerr[Debug::GUI] << "Using mathed-provided icon"
+                                          << endl;
+                       fl_set_pixmapbutton_data(obj,
+                                                const_cast<char **>(pixmap));
+                       return;
+               }
        }
        
        lyxerr << "Unable to find icon `" << xpm_name << "'" << endl;