         selection.overlayIdentifier = activeOverlay.identifier
 
         var activeFilters = [String: String]()
-        for f in activeSubtype.type.filters {
-            activeFilters[f.title] = f.activeValue.title
+        if let type = activeSubtype.type {
+            for f in type.filters {
+                activeFilters[f.title] = f.activeValue.title
+            }
         }
 
         selection.activeFilters = activeFilters


        let filterResult = NSMutableDictionary()

        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,
            let type = activeSubtype.type {
            for f in type.filters {
                if let activeFilterValueTitle = activeFilters[f.title] {

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