From a391f7e96c2ea29692a33bf167e2dad106eb4c8d Mon Sep 17 00:00:00 2001 From: Martin Hawlisch Date: Thu, 21 Apr 2005 12:25:35 +0000 Subject: [PATCH] * src/ReadGedcom.py (importData): Dont crash because of a short line; svn: r4397 --- gramps2/ChangeLog | 3 ++- gramps2/src/ReadGedcom.py | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/gramps2/ChangeLog b/gramps2/ChangeLog index 5a581ff7d..623ddebab 100644 --- a/gramps2/ChangeLog +++ b/gramps2/ChangeLog @@ -1,6 +1,7 @@ 2005-04-21 Martin Hawlisch * src/ReadGedcom.py (parse_family_object): Set MediaRef properly; - (parse_individual): Set Adoption event properly + (parse_individual): Set Adoption event properly; + (importData): Dont crash because of a short line; * src/Marriage.py (__init__): Properly get place title 2005-04-20 Don Allingham diff --git a/gramps2/src/ReadGedcom.py b/gramps2/src/ReadGedcom.py index 7cae98af7..29dcf7f42 100644 --- a/gramps2/src/ReadGedcom.py +++ b/gramps2/src/ReadGedcom.py @@ -142,9 +142,9 @@ def importData(database, filename, cb=None, use_trans=True): line = f.readline().split() if len(line) == 0: break - if line[1] == 'CHAR' and line[2] == "ANSEL": + if len(line) > 2 and line[1] == 'CHAR' and line[2] == "ANSEL": ansel = True - if line[1] == 'SOUR' and line[2] == "GRAMPS": + if len(line) > 2 and line[1] == 'SOUR' and line[2] == "GRAMPS": gramps = True f.close()