Ignore:
Timestamp:
2016-08-07T17:55:17+02:00 (8 years ago)
Author:
Don-vip
Message:

sonar - squid:S1696 - "NullPointerException" should not be caught

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/tools/Utils.java

    r10748 r10761  
    12481248     */
    12491249    public static boolean isValidUrl(String url) {
    1250         try {
    1251             new URL(url);
    1252             return true;
    1253         } catch (MalformedURLException | NullPointerException e) {
    1254             Main.trace(e);
    1255             return false;
    1256         }
     1250        if (url != null) {
     1251            try {
     1252                new URL(url);
     1253                return true;
     1254            } catch (MalformedURLException e) {
     1255                Main.trace(e);
     1256            }
     1257        }
     1258        return false;
    12571259    }
    12581260
Note: See TracChangeset for help on using the changeset viewer.