diff --git a/geonode/maps/api/views.py b/geonode/maps/api/views.py index d28276e881a..d110d9195a0 100644 --- a/geonode/maps/api/views.py +++ b/geonode/maps/api/views.py @@ -118,7 +118,7 @@ def perform_create(self, serializer): # Thumbnail will be handled later post_creation_data = {"thumbnail": serializer.validated_data.pop("thumbnail_url", "")} map_layers = serializer.validated_data.get("maplayers", []) - tabular_collection = all(("tabular" in layer.dataset.subtype) for layer in map_layers) + tabular_collection = all(layer.dataset and ("tabular" in layer.dataset.subtype) for layer in map_layers) instance = serializer.save( owner=self.request.user,