From 2e6f54b37ffc2c152dd85ae2b4cb74c6a9096543 Mon Sep 17 00:00:00 2001 From: Juergen Spitzmueller Date: Mon, 28 Dec 2015 16:10:26 +0100 Subject: [PATCH] Eclude possible unwandted case --- lib/lyx2lyx/lyx_2_1.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/lyx2lyx/lyx_2_1.py b/lib/lyx2lyx/lyx_2_1.py index 8faf61a9d9..f6ab187415 100644 --- a/lib/lyx2lyx/lyx_2_1.py +++ b/lib/lyx2lyx/lyx_2_1.py @@ -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: -- 2.39.2