diff --git a/openquake/calculators/classical.py b/openquake/calculators/classical.py
index <HASH>..<HASH> 100644
--- a/openquake/calculators/classical.py
+++ b/openquake/calculators/classical.py
@@ -244,6 +244,8 @@ def build_hcurves_and_stats(pgetter, hstats, monitor):
             pmaps = pgetter.get_pmaps(pgetter.sids)
         except IndexError:  # no data
             return {}
+        if sum(len(pmap) for pmap in pmaps) == 0:  # no data
+            return {}
     pmap_by_kind = {}
     for kind, stat in hstats:
         with monitor('compute ' + kind):
Fixed build_hcurves_and_stats [skip hazardlib] [demos]


Former-commit-id: <I>db<I>fb<I>f<I>e<I>b1babb<I>a<I>eb<I>ac