 
         let filterResult = NSMutableDictionary()
 
-        for f in type.filters {
-            filterResult.addEntries(from: f.activeValue.info as! [AnyHashable: Any])
+        if let type = type {
+            for f in type.filters {
+                filterResult.addEntries(from: f.activeValue.info as! [AnyHashable: Any])
+            }
         }
 
         result.setObject(filterResult, forKey: "filter" as NSCopying)

            }
        }

        if let activeFilters = selection.activeFilters {
            for f in activeSubtype.type.filters {
                if let activeFilterValueTitle = activeFilters[f.title] {

                    if let v = f.possibleValues.filter({ a in

            "map_options": mapOptions
        ])

        if let type = type {
            for f in type.filters {
                result.addEntries(from: f.activeValue.info as! [AnyHashable: Any])
            }
