stop erroring every time a category is selected for an untagged way
authorRichard Fairhurst <richard@systemed.net>
Wed, 1 Dec 2010 10:29:01 +0000 (10:29 +0000)
committerRichard Fairhurst <richard@systemed.net>
Wed, 1 Dec 2010 10:29:01 +0000 (10:29 +0000)
net/systemeD/potlatch2/CategorySelector.mxml

index 6713e85..e71da79 100644 (file)
@@ -87,6 +87,7 @@
           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;