Changeset 17688 in josm for trunk/src/org


Ignore:
Timestamp:
2021-03-30T09:03:19+02:00 (4 years ago)
Author:
simon04
Message:

see #19724 - Fix NPE in PlatformHookWindows.getInstalledFonts on Linux/macOS

File:
1 edited

Legend:

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

    r17679 r17688  
    529529        // Use more low-level method to find the installed fonts.
    530530        List<String> fontsAvail = new ArrayList<>();
    531         Path fontPath = FileSystems.getDefault().getPath(getSystemEnv("SYSTEMROOT"), "Fonts");
     531        String systemRoot = getSystemEnv("SYSTEMROOT");
     532        if (systemRoot == null) {
     533            return fontsAvail;
     534        }
     535        Path fontPath = FileSystems.getDefault().getPath(systemRoot, "Fonts");
    532536        try (DirectoryStream<Path> ds = Files.newDirectoryStream(fontPath)) {
    533537            for (Path p : ds) {
Note: See TracChangeset for help on using the changeset viewer.