-
Notifications
You must be signed in to change notification settings - Fork 29
Open
Description
Hi,
Just noticed this NPE, wondered if this is normal or an OS-related issue somehow.
My code calls OsThemeDetector.getDetector().isDark()
at some point, and the full stack trace reads
[AWT-EventQueue-0] ERROR com.jthemedetecor.MacOSThemeDetector - Couldn't execute theme name query with the Os
java.lang.NullPointerException
at java.base/java.util.regex.Matcher.getTextLength(Matcher.java:1770)
at java.base/java.util.regex.Matcher.reset(Matcher.java:416)
at java.base/java.util.regex.Matcher.<init>(Matcher.java:253)
at java.base/java.util.regex.Pattern.matcher(Pattern.java:1133)
at com.jthemedetecor.MacOSThemeDetector.isDarkTheme(MacOSThemeDetector.java:96)
at com.jthemedetecor.MacOSThemeDetector.isDark(MacOSThemeDetector.java:86)
More specifically, the NPE is due to the following call (within the isDark()
method) returning the '0' byte:
Foundation.invoke(userDefaults, "objectForKey:", Foundation.nsString("AppleInterfaceStyle"))
I should mention that this happens during daytime (and luckily isDark()
returns false
), so no harm done (besides an avoidable(?) pollution of the logger)
Any clue where that might come from?
In case this helps: using version 3.7 @ openjdk11 @ macOS 10.15.7
kerner1000
Metadata
Metadata
Assignees
Labels
No labels