diff --git a/leafmap/leafmap.py b/leafmap/leafmap.py index c79f1828be..fd14d07b17 100644 --- a/leafmap/leafmap.py +++ b/leafmap/leafmap.py @@ -1150,7 +1150,10 @@ def add_stac_layer( nodata = None band_names = stac_bands(url, collection, item, titiler_endpoint) - indexes = [band_names.index(band) + 1 for band in assets] + if assets is not None: + indexes = [band_names.index(band) + 1 for band in assets] + else: + indexes = None params = { "url": url, diff --git a/leafmap/stac.py b/leafmap/stac.py index 3b9628ba6e..cf7800078a 100644 --- a/leafmap/stac.py +++ b/leafmap/stac.py @@ -897,10 +897,13 @@ def stac_min_max( values = stats.values() - min_values = [v["min"] for v in values] - max_values = [v["max"] for v in values] + try: + min_values = [v["min"] for v in values] + max_values = [v["max"] for v in values] - return min(min_values), max(max_values) + return min(min_values), max(max_values) + except Exception as e: + return None, None def stac_info(