Changeset 18327 in josm
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/tagging/presets/items/PresetListEntry.java
r18257 r18327 189 189 */ 190 190 public int getCount() { 191 Integer count = cms == null ? null : cms.usage.map.get(value);191 Integer count = cms == null || cms.usage == null ? null : cms.usage.map.get(value); 192 192 return count == null ? 0 : count; 193 193 } -
trunk/test/unit/org/openstreetmap/josm/gui/tagging/presets/items/PresetListEntryTest.java
r18254 r18327 2 2 package org.openstreetmap.josm.gui.tagging.presets.items; 3 3 4 import static org.junit.jupiter.api.Assertions.assertDoesNotThrow; 4 5 import static org.junit.jupiter.api.Assertions.assertTrue; 5 6 … … 28 29 assertTrue(new PresetListEntry("", null).getListDisplay(200).contains(" ")); 29 30 } 31 32 /** 33 * Non-regression test for ticket <a href="https://josm.openstreetmap.de/ticket/21550">#21550</a> 34 */ 35 @Test 36 void testTicket21550() { 37 final PresetListEntry entry = new PresetListEntry("", new Combo()); 38 assertDoesNotThrow(entry::getCount); 39 } 30 40 }
Note:
See TracChangeset
for help on using the changeset viewer.