diff --git a/ddapioper.py b/ddapioper.py index 617ab6a..253c960 100644 --- a/ddapioper.py +++ b/ddapioper.py @@ -233,9 +233,14 @@ Returns the results part of the response. def aspectSet(self): """aspectSet() -Returns the metadata of the aspectSet +Returns the metadata of the aspectSet. + +Note: Return a empty dict if there is no aspectset (matroos) """ - return(self.result()["observationType"]["aspectSet"]["aspects"]) + observationType = self.result().get("observationType", {}) + aspectSet = observationType.get("aspectSet", {}) + aspects = aspectSet.get("aspects", {}) + return(aspects) def location(self): """location()