VideoGameSmash12 / HotbarsPlus

Get more use out of your saved hotbars!
MIT License
10 stars 2 forks source link

Client crashes from a bug in the tray notification system #23

Closed VideoGameSmash12 closed 1 year ago

VideoGameSmash12 commented 1 year ago

Turns out I didn't account for the possibility of the system tray integration failing to initialize when trying to handle notifications, so if you try to do anything that triggers the tray notification after it failed to initialize, it crashes the client. Whoops.

Caused by: java.lang.NullPointerException: Cannot invoke "java.awt.TrayIcon.displayMessage(String, String, java.awt.TrayIcon$MessageType)" because "this.icon" is null
    at me.videogamesm12.hotbarsplus.core.notifications.TrayNotification.display(TrayNotification.java:68) ~[Hotbars+-2.0-pre5.jar:?]
    at me.videogamesm12.hotbarsplus.core.universal.NotificationManager.lambda$showNotification$0(NotificationManager.java:66) ~[Hotbars+-2.0-pre5.jar:?]
    at java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:183) ~[?:?]
    at java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:179) ~[?:?]
    at java.util.HashMap$ValueSpliterator.forEachRemaining(HashMap.java:1779) ~[?:?]
    at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509) ~[?:?]
    at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499) ~[?:?]
    at java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150) ~[?:?]
    at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173) ~[?:?]
    at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) ~[?:?]
    at java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:596) ~[?:?]
    at me.videogamesm12.hotbarsplus.core.universal.NotificationManager.showNotification(NotificationManager.java:65) ~[Hotbars+-2.0-pre5.jar:?]
    at me.videogamesm12.hotbarsplus.core.universal.NotificationManager$EventListener.onBackupFailure(NotificationManager.java:157) ~[Hotbars+-2.0-pre5.jar:?]
    at me.videogamesm12.hotbarsplus.api.event.failures.BackupFailEvent.lambda$static$0(BackupFailEvent.java:31) ~[Hotbars+-2.0-pre5.jar:?]
    at me.videogamesm12.hotbarsplus.core.universal.BackupManager.backupHotbar(BackupManager.java:68) ~[Hotbars+-2.0-pre5.jar:?]
    at me.videogamesm12.hotbarsplus.core.universal.BackupManager.backupHotbar(BackupManager.java:77) ~[Hotbars+-2.0-pre5.jar:?]