Ignore:
Timestamp:
2010-01-31T18:07:03+01:00 (14 years ago)
Author:
jttt
Message:

Fixed #4451 Error message trying to edit a restriction element

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/dialogs/RelationListDialog.java

    r2894 r2914  
    222222            model.setSelectedRelations(Collections.singletonList(relation));
    223223            Integer i = model.getRelationIndex(relation);
    224             if (i == null)
    225                 throw new AssertionError(); /* the relation list should contain *all* relations */
    226             displaylist.scrollRectToVisible(displaylist.getCellBounds(i, i));
     224            if (i != null) { // Not all relations have to be in the list (for example when the relation list is hidden, it's not updated with new relations)
     225                displaylist.scrollRectToVisible(displaylist.getCellBounds(i, i));
     226            }
    227227        }
    228228    }
     
    693693         * Returns the index of the relation
    694694         *
    695          * @return index of relation (null if it cannot be found) 
     695         * @return index of relation (null if it cannot be found)
    696696         */
    697697        public Integer getRelationIndex(Relation rel) {
    698698            int i = relations.indexOf(rel);
    699             if (i<0) {
     699            if (i<0)
    700700                return null;
    701             }
    702701            return i;
    703702        }
    704            
     703
    705704    }
    706705
Note: See TracChangeset for help on using the changeset viewer.