stop erroring every time a category is selected for an untagged way
[potlatch2.git] / net / systemeD / potlatch2 / CategorySelector.mxml
index 6713e850240ac1afbd1987006238e3593036eb6e..e71da7996a2fe35303779dd19153e8d0aac3158c 100644 (file)
@@ -87,6 +87,7 @@
           if ( feature != null ) {
               var primaryCategory:Category = feature.findFirstCategory();
               index = MapFeatures.getInstance().getCategoriesForType(limit).indexOf(primaryCategory);
           if ( feature != null ) {
               var primaryCategory:Category = feature.findFirstCategory();
               index = MapFeatures.getInstance().getCategoriesForType(limit).indexOf(primaryCategory);
+              if (index==-1) { index=0; }      // not found, so just show the default for now
           }
           var event:IndexChangedEvent = new IndexChangedEvent(IndexChangedEvent.CHANGE);
           event.oldIndex = _formerIndex;
           }
           var event:IndexChangedEvent = new IndexChangedEvent(IndexChangedEvent.CHANGE);
           event.oldIndex = _formerIndex;