From 7487e7b5620e40b36988bb2da47f4a43ca11ed0f Mon Sep 17 00:00:00 2001 From: "Peter A. Jonsson" Date: Mon, 18 Nov 2024 13:53:55 +0100 Subject: [PATCH] Do not hang on empty stac file Check that there is a document returned from parse_doc_stream, so a zero byte file does not crash s3_to_dc. --- apps/dc_tools/odc/apps/dc_tools/s3_to_dc.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/apps/dc_tools/odc/apps/dc_tools/s3_to_dc.py b/apps/dc_tools/odc/apps/dc_tools/s3_to_dc.py index cf3dc0fab..c0e4e0cff 100755 --- a/apps/dc_tools/odc/apps/dc_tools/s3_to_dc.py +++ b/apps/dc_tools/odc/apps/dc_tools/s3_to_dc.py @@ -62,6 +62,9 @@ def dump_to_odc( found_docs = False for uri, metadata in uris_docs: + if metadata is None: + ds_skipped += 1 + continue found_docs = True stac_doc = None if transform: