Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NullPointerException with MacOSThemeDetector.isDark on Mac Monterey #25

Closed
mgroth0 opened this issue May 21, 2022 · 1 comment
Closed

Comments

@mgroth0
Copy link

mgroth0 commented May 21, 2022

	java.lang.NullPointerException: Cannot invoke "java.lang.CharSequence.length()" because "this.text" is null
	at java.base/java.util.regex.Matcher.getTextLength(Matcher.java:1769)
	at java.base/java.util.regex.Matcher.reset(Matcher.java:415)
	at java.base/java.util.regex.Matcher.<init>(Matcher.java:252)
	at java.base/java.util.regex.Pattern.matcher(Pattern.java:1134)
	at com.jthemedetecor.MacOSThemeDetector.isDarkTheme(MacOSThemeDetector.java:96)
	at com.jthemedetecor.MacOSThemeDetector.isDark(MacOSThemeDetector.java:86)

Maybe Foundation.toStringViaUTF8(Foundation.invoke(userDefaults, "objectForKey:", Foundation.nsString("AppleInterfaceStyle"))) is returning null for some reason. i don't know why.

I'm on MacOS 12.3.1

@mgroth0
Copy link
Author

mgroth0 commented May 21, 2022

Oops, this is the same as #18

@mgroth0 mgroth0 closed this as completed May 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant