Skip to content

Commit

Permalink
Merge pull request #200 from Tamookk/bug-fixes
Browse files Browse the repository at this point in the history
Bug Fix: Crash when clinical data CSV does not exist
  • Loading branch information
didymo authored Oct 22, 2021
2 parents b4266b8 + 356aecc commit 57b42f0
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/View/mainpage/ClinicalDataView.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,11 +154,8 @@ def import_clinical_data(self):
return

# Get CSV data
if file_path != "" and file_path is not None:
if os.path.exists(file_path):
with open(file_path, newline="") as stream:
data = list(csv.reader(stream))
else:
if file_path == "" or file_path is None \
or not os.path.exists(file_path):
# Clear table
self.clear_table()

Expand All @@ -171,6 +168,9 @@ def import_clinical_data(self):
self.table_cd.setItem(0, 1, value)
return

with open(file_path, newline="") as stream:
data = list(csv.reader(stream))

# See if CSV data matches patient ID
patient_in_file = False
row_num = 0
Expand Down

0 comments on commit 57b42f0

Please sign in to comment.