mickleness / pumpernickel

This Java project includes classes related to desktop applications, Swing, performance, image processing, data structures, and other misc topics.
https://mickleness.github.io/pumpernickel/
MIT License
66 stars 12 forks source link

NPE PointerInfo #78

Closed mickleness closed 1 year ago

mickleness commented 3 years ago

This line generated a NPE: Point mouse = MouseInfo.getPointerInfo().getLocation();

I should walk through the repo and make sure all references to getPointerInfo can handle a null return value.

java.lang.NullPointerException: Cannot invoke "java.awt.PointerInfo.getLocation()" because the return value of "java.awt.MouseInfo.getPointerInfo()" is null
    at com.pump.swing.popover.BasicPopoverVisibility.isRollover(BasicPopoverVisibility.java:139)
    at com.pump.swing.popover.BasicPopoverVisibility.isVisible(BasicPopoverVisibility.java:96)
    at com.pump.swing.popover.JPopover.refreshVisibility(JPopover.java:329)
    at com.pump.swing.popover.JPopover$7.run(JPopover.java:308)
    at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:316)
    at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:770)
    at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721)
    at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:715)
    at java.base/java.security.AccessController.doPrivileged(AccessController.java:391)
    at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
    at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:740)
    at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
    at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
    at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:117)
    at java.desktop/java.awt.WaitDispatchSupport$2.run(WaitDispatchSupport.java:190)
    at java.desktop/java.awt.WaitDispatchSupport$4.run(WaitDispatchSupport.java:235)
    at java.desktop/java.awt.WaitDispatchSupport$4.run(WaitDispatchSupport.java:233)
    at java.base/java.security.AccessController.doPrivileged(AccessController.java:312)
    at java.desktop/java.awt.WaitDispatchSupport.enter(WaitDispatchSupport.java:233)
    at java.desktop/java.awt.Dialog.show(Dialog.java:1070)
    at java.desktop/java.awt.Component.show(Component.java:1717)
    at java.desktop/java.awt.Component.setVisible(Component.java:1664)
    at java.desktop/java.awt.Window.setVisible(Window.java:1023)
    at java.desktop/java.awt.Dialog.setVisible(Dialog.java:1005)
    at com.pump.desktop.error.ErrorDialogThrowableHandler$1.run(ErrorDialogThrowableHandler.java:46)
    at com.pump.desktop.error.ErrorDialogThrowableHandler.processThrowable(ErrorDialogThrowableHandler.java:58)
    at com.pump.desktop.error.ErrorManager.process(ErrorManager.java:89)
    at com.pump.desktop.error.ErrorManager.process(ErrorManager.java:74)
    at com.pump.desktop.error.ErrorManager$1.uncaughtException(ErrorManager.java:62)
    at java.base/java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:1053)
    at java.base/java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:1048)
    at java.desktop/java.awt.EventDispatchThread.processException(EventDispatchThread.java:222)
    at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:214)
    at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
    at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
    at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
    at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
    at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)
mickleness commented 1 year ago

Closing as duplicate of #105