From a97e5e1ecedcaec64d1a2cfd45714519bbcb82a5 Mon Sep 17 00:00:00 2001 From: spaulins-usgs Date: Fri, 15 Nov 2019 06:51:03 -0800 Subject: [PATCH] fix(mflist optimization): The mflist optimization code crashed when a line contained a word that only contained quote characters. Fix implemented to handle this case. --- flopy/mf6/data/mffileaccess.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/flopy/mf6/data/mffileaccess.py b/flopy/mf6/data/mffileaccess.py index ecebc82571..11e1bc422f 100644 --- a/flopy/mf6/data/mffileaccess.py +++ b/flopy/mf6/data/mffileaccess.py @@ -1002,7 +1002,8 @@ def read_list_data_from_file(self, file_handle, storage, current_key, len(self._last_line_info):]: if arr_line_len <= data_index: break - if arr_line[data_index][0] == '#': + if len(arr_line[data_index]) > 0 and \ + arr_line[data_index][0] == '#': break elif data_item.name == 'aux': data_index, self._data_line = \