Prevent error if + pressed while nothing is selected
authorAndy Allan <gravitystorm@gmail.com>
Fri, 3 Sep 2010 14:08:35 +0000 (14:08 +0000)
committerAndy Allan <gravitystorm@gmail.com>
Fri, 3 Sep 2010 14:08:35 +0000 (14:08 +0000)
net/systemeD/potlatch2/TagViewer.mxml

index 213c0d1..244e1d4 100644 (file)
       }
 
       public function addNewTag():void {
-          if (stack.selectedChild!=advancedContainer) { return; }
+          if (stack.selectedChild!=advancedContainer || selectedEntity == null) { return; }
           var newKey:String = "(new tag)";
           var newTag:Tag = new Tag(selectedEntity, newKey, "(new value)");
           tagDataProvider.addItem(newTag);