From 17bb88faf41769045ff92501bdc4bef14009324f Mon Sep 17 00:00:00 2001 From: "D. Berge" Date: Mon, 7 Mar 2022 21:08:22 +0100 Subject: [PATCH] Cope with P1/11s with no S records --- bin/import_raw_p111.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/bin/import_raw_p111.py b/bin/import_raw_p111.py index 71991b8..00c15ac 100755 --- a/bin/import_raw_p111.py +++ b/bin/import_raw_p111.py @@ -82,9 +82,12 @@ if __name__ == '__main__': print("Saving") p111_records = p111.p111_type("S", p111_data) - file_info["meta"]["lineName"] = p111.line_name(p111_data) + if len(p111_records): + file_info["meta"]["lineName"] = p111.line_name(p111_data) - db.save_raw_p111(p111_records, file_info, filepath, survey["epsg"], ntbp=ntbp) + db.save_raw_p111(p111_records, file_info, filepath, survey["epsg"], ntbp=ntbp) + else: + print("No source records found in file") else: print("Already in DB")