Changeset 13466 in josm


Ignore:
Timestamp:
2018-02-26T19:32:16+01:00 (16 months ago)
Author:
Don-vip
Message:

fix #15992 - fix NPE

File:
1 edited

Legend:

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

    r13465 r13466  
    704704            // Great, but our WinRegistry only handles REG_SZ type, so we have to check the Version key
    705705            String version = WinRegistry.readString(HKEY_LOCAL_MACHINE, "SOFTWARE\\Microsoft\\NET Framework Setup\\NDP\\v4\\Full", "Version");
    706             Matcher m = Pattern.compile("(\\d+)\\.(\\d+)(\\.\\d+.*)?").matcher(version);
    707             if (m.matches()) {
    708                 int maj = Integer.valueOf(m.group(1));
    709                 int min = Integer.valueOf(m.group(2));
    710                 return (maj == 4 && min >= 5) || maj > 4;
     706            if (version != null) {
     707                Matcher m = Pattern.compile("(\\d+)\\.(\\d+)(\\.\\d+.*)?").matcher(version);
     708                if (m.matches()) {
     709                    int maj = Integer.valueOf(m.group(1));
     710                    int min = Integer.valueOf(m.group(2));
     711                    return (maj == 4 && min >= 5) || maj > 4;
     712                }
    711713            }
    712714        } catch (IllegalAccessException | InvocationTargetException | NumberFormatException e) {
Note: See TracChangeset for help on using the changeset viewer.