diff --git a/qgis/export.py b/qgis/export.py index 7bc5315..b3894fc 100644 --- a/qgis/export.py +++ b/qgis/export.py @@ -61,6 +61,13 @@ def unique_attributes(layer): map_layers = project.mapLayers().items() layers = [v for k, v in map_layers if re.search(r'\d{4}', v.name())] +try: + next(layers[0].getFeatures()) +except StopIteration: + msg = 'No hazard lines found. Check shapefile data.' + raise ValueError(msg) + + # Get all EP values and profile types from first hazard line layer eps, types, years = unique_attributes(layers[0])