]> git.lyx.org Git - features.git/commitdiff
Eclude possible unwandted case
authorJuergen Spitzmueller <spitz@lyx.org>
Mon, 28 Dec 2015 15:10:26 +0000 (16:10 +0100)
committerJuergen Spitzmueller <spitz@lyx.org>
Mon, 28 Dec 2015 15:10:26 +0000 (16:10 +0100)
lib/lyx2lyx/lyx_2_1.py

index 8faf61a9d9764960595c18a0b8ccf52b79e8647b..f6ab1874157d9df84216839c6310baaaa7e57544 100644 (file)
@@ -181,7 +181,7 @@ def convert_TeX_brace_to_Argument(document, line, n, nmax, inset, environment, o
             else:
               beginBrace = find_token(document.body, "{", endBrace, end_layout)
             # assure that the ERTs are consecutive (11 or 12 depending if there is a space between the ERTs or not)
-            if beginBrace == endBrace + 11 or beginBrace == endBrace + 12:
+            if beginBrance != -1 and (beginBrace == endBrace + 11 or beginBrace == endBrace + 12):
               end = find_token(document.body, "\\end_inset", beginBrace)
               document.body[lineERT : end + 1] = ["\\end_layout", "", "\\end_inset"]
               if loop == 1: