]> git.lyx.org Git - lyx.git/blobdiff - lib/lyx2lyx/lyx_1_1_5.py
Consider the case where there is not any layout name.
[lyx.git] / lib / lyx2lyx / lyx_1_1_5.py
index 4f533a9c6dd34f244cc2b869216e323c7fef44ff..00b84d2a3fafd9c2fc42f4e7307cae2610303bf0 100644 (file)
@@ -33,7 +33,11 @@ def replace_protected_separator(file):
             break
         j = find_token_backwards(lines, "\\layout", i)
         #if j == -1: print error
-        layout = layout_exp.match(lines[j]).group(1)
+        layout_m = layout_exp.match(lines[j])
+        if layout_m:
+            layout = layout_m.group(1)
+        else:
+            layout = "Standard"
 
         if layout == "LyX-Code":
             result = ""