From 3bb26dc40031f304cf36f330f6ac07deed9a7733 Mon Sep 17 00:00:00 2001 From: ache Date: Mon, 7 Nov 2022 10:39:00 +0100 Subject: Fix null and empty API access --- dfr/dump2msgp.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/dfr/dump2msgp.py b/dfr/dump2msgp.py index 7e355c7..0867a87 100644 --- a/dfr/dump2msgp.py +++ b/dfr/dump2msgp.py @@ -44,8 +44,8 @@ if __name__ == '__main__': from sectionList import listInfoSection from template import template else: - from dfr.sectionList import listInfoSection - from dfr.template import template + from sectionList import listInfoSection + from template import template dictMatch = {x['match']: i for (i, x) in enumerate(listInfoSection)} @@ -216,7 +216,8 @@ def extract(f, w, errorF): p1 += 2 p = line[p0:p1] p = p.split('|') - info['API'] = p[1] + if len(p) > 2: + info['API'] = p[1] if '{{m}}' in line: info['genre'] = 'mas' elif '{{f}}' in line: -- cgit v1.2.3