codecentric / NSMenuFX

Other
128 stars 27 forks source link

NPE Input stream must not be null on MacOS Big Sur beta #37

Closed dannygonzalez closed 3 years ago

dannygonzalez commented 4 years ago

We have customers trying out our application in MacOS Big Sur and they are experiencing the following crash in our application:

15:25:12,623 [JavaFX Application Thread] (CrashHandler.java:129) FATAL - Thread: Thread[JavaFX Application Thread,5,main]
java.lang.NullPointerException: Input stream must not be null
    at javafx.scene.image.Image.validateInputStream(Image.java:1117) ~[javafx-graphics-12.0.14-sf13-mac.jar:?]
    at javafx.scene.image.Image.<init>(Image.java:701) ~[javafx-graphics-12.0.14-sf13-mac.jar:?]
    at de.codecentric.centerdevice.MenuToolkit.createDefaultAboutStage(MenuToolkit.java:85) ~[centerdevice-nsmenufx-2.1.6.jar:?]
    at de.codecentric.centerdevice.MenuToolkit.createDefaultApplicationMenu(MenuToolkit.java:66) ~[centerdevice-nsmenufx-2.1.6.jar:?]

The crash is due to the call to IcnsParser.getIconStream() returning null. It's looking for a "ic08" icon type which now no longer exists in /System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/GenericApplication.icns.

Comparing this with the equivalent file in Catalina, I can see that Catalina's version has 10 icons compared to Big Sur which has only 4 in the icon set.

Are there any plans to test this with the current MacOS Big Sur beta?

Thanks

vewert commented 3 years ago

Any chance that the PR, mentioned, will be incorporated, and a new release will be put out?

0x4a616e commented 3 years ago

I'd be happy to publish a new release but as I left codecentric, I can no longer publish to the old coordinates in Sonatype OSSHR. What I could offer in the short term is to publish the update with a different groupId and update the README accordingly. I could also try to find some volunteer within codecentric to upload releases on my behalf, but that might take a bit more time.

mipastgt commented 3 years ago

Unless Codecentric is going to actively maintain NSMenuFX in the future, the first option seems to be the right way to go anyway.

0x4a616e commented 3 years ago

I pushed a new release here:

<dependency>
  <groupId>de.jangassen</groupId>
  <artifactId>nsmenufx</artifactId>
  <version>2.1.8</version>
</dependency>

which was built from https://github.com/0x4a616e/NSMenuFX

For now, the package names within the release have not changed, but this might change with the next major version update.

mipastgt commented 3 years ago

Thanks. Just made the switch and everything works like before.

vewert commented 3 years ago

@0x4a616e Thanks for getting on this!

@ekaem In your fix for this, you mentioned it works for Catalina and Big Sur. Will this fix work on older versions of macOS as well, or will it cause them to break (because they maybe don't have ic09)?

ekaem commented 3 years ago

I tested on Mojave and it was fine, but I don't have access to a machine with an earlier OS than that.

vewert commented 3 years ago

Thanks @ekaem, that is good to know; with the release of Big Sur, I believe High Sierra, will soon be EOL anyway.

rinaldo-lisario commented 3 years ago

Thanks @ekaem and @0x4a616e , we've updated to 2.1.8 and it works well on Big Sur.

0x4a616e commented 3 years ago

Thank you all for helping out with this!