Skip to content

Commit f882c65

Browse files
committed
Check for null ltab in generators_json()
1 parent 805520e commit f882c65

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

t2data.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2412,7 +2412,8 @@ def specified_injection_generator_json(g, gen):
24122412

24132413
def delv_generator_json(g, gen):
24142414
"""DELV generator type."""
2415-
if gen.ltab > 1:
2415+
ltab = 0 if gen.ltab is None else gen.ltab
2416+
if ltab > 1:
24162417
raise Exception('DELV generator with multiple layers not supported.')
24172418
else:
24182419
g['deliverability'] = {'productivity': gen.gx,
@@ -2473,7 +2474,8 @@ def table_generator_json(g, gen):
24732474
g['averaging'] = averaging_type
24742475
data_table = [list(r) for r in zip(gen.time, gen.rate)]
24752476
if gen.type in ['DELG', 'DMAK', 'DMAT', 'DELT', 'DELW']:
2476-
if gen.ltab > 0:
2477+
ltab = 0 if gen.ltab is None else gen.ltab
2478+
if ltab > 0:
24772479
g['deliverability']['productivity'] = {'time': data_table}
24782480
else:
24792481
g['deliverability']['pressure'] = {'enthalpy': data_table}

0 commit comments

Comments
 (0)