Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/Functions.java
r18875 r18876 629 629 */ 630 630 public static boolean has_tag_key(final Environment env, String key) { 631 return env.osm != null ?env.osm.hasKey(key): false;631 return env.osm != null && env.osm.hasKey(key); 632 632 } 633 633 … … 852 852 */ 853 853 public static Boolean JOSM_search(final Environment env, String searchStr) { 854 if (env.osm == null) { 855 return null; 856 } 854 857 Match m; 855 858 try { -
trunk/test/unit/org/openstreetmap/josm/gui/mappaint/mapcss/FunctionsTest.java
r18875 r18876 260 260 /** 261 261 * Non-regression test for #23238: NPE when env.osm is null 262 * @see #testNonRegression23238JOSMSearch() 262 263 */ 263 264 @ParameterizedTest … … 288 289 } 289 290 } 291 292 /** 293 * Non-regression test for #23238: NPE when env.osm is null and {@link Functions#JOSM_search(Environment, String)} 294 * has a non-empty search string. 295 * @see #testNonRegression23238(Method) 296 */ 297 @Test 298 void testNonRegression23238JOSMSearch() { 299 assertDoesNotThrow(() -> Functions.JOSM_search(new Environment(), "foobar")); 300 } 290 301 }
Note:
See TracChangeset
for help on using the changeset viewer.