[LyX/master] Avoid crash when string only has one char

José Matos jamatos at lyx.org
Thu Sep 17 23:42:43 UTC 2020


commit 5154400b641a46b27a35e90d97aca725e541a14a
Author: José Matos <jamatos at lyx.org>
Date:   Fri Sep 18 01:09:36 2020 +0100

    Avoid crash when string only has one char
---
 lib/lyx2lyx/lyx_2_4.py |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/lib/lyx2lyx/lyx_2_4.py b/lib/lyx2lyx/lyx_2_4.py
index 3fd876c..9c72406 100644
--- a/lib/lyx2lyx/lyx_2_4.py
+++ b/lib/lyx2lyx/lyx_2_4.py
@@ -3512,7 +3512,7 @@ def revert_totalheight(document):
                     if ms:
                         oldval = ms.group(1)
                         oldunit = ms.group(2)
-                        if oldval[1] == ".":
+                        if len(oldval) > 1 and oldval[1] == ".":
                             oldval = "0" + oldval
                         if oldunit in list(relative_heights.keys()):
                             oldval = str(float(oldval) * 100)


More information about the lyx-cvs mailing list