]> git.lyx.org Git - lyx.git/blobdiff - src/LyXRC.cpp
Fix bug #9907: We get a crash if we first close a master buffer one of
[lyx.git] / src / LyXRC.cpp
index 4fb1b027c0ecf9fbbba6cd01bef885bd1db62d11..e18a9d6f62e2500015795c9933a83e37837f8b2f 100644 (file)
@@ -1055,16 +1055,18 @@ LyXRC::ReturnValues LyXRC::read(Lexer & lexrc, bool check_format)
                }
                case RC_VIEWER_ALTERNATIVES:  {
                        string format, command;
-                       lexrc >> format;
-                       lexrc >> command;
-                       viewer_alternatives[format].insert(command);
+                       if ((lexrc >> format) && lexrc.next(true)) {
+                               command  = lexrc.getString();
+                               viewer_alternatives[format].insert(command);
+                       }
                        break;
                }
                case RC_EDITOR_ALTERNATIVES:  {
                        string format, command;
-                       lexrc >> format;
-                       lexrc >> command;
-                       editor_alternatives[format].insert(command);
+                       if ((lexrc >> format) && lexrc.next(true)) {
+                               command  = lexrc.getString();
+                               editor_alternatives[format].insert(command);
+                       }
                        break;
                }