Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException: Cannot invoke "java.lang.Long.longValue()" because the return value of "java.util.HashMap.get(Object)" is null at LineGraph$1.compare(LineGraph.java:60) at LineGraph$1.compare(LineGraph.java:58) at java.base/java.util.TimSort.binarySort(TimSort.java:296) at java.base/java.util.TimSort.sort(TimSort.java:239) at java.base/java.util.Arrays.sort(Arrays.java:1308) at java.base/java.util.ArrayList.sort(ArrayList.java:1804) at java.base/java.util.Collections.sort(Collections.java:178) at LineGraph.sortYearly(LineGraph.java:58) at LineGraph.monthly(LineGraph.java:76) at LineGraph.paintComponent(LineGraph.java:54) at java.desktop/javax.swing.JComponent.paint(JComponent.java:1128) at java.desktop/javax.swing.JComponent.paintChildren(JComponent.java:961) at java.desktop/javax.swing.JComponent.paint(JComponent.java:1137) at java.desktop/javax.swing.JComponent.paintChildren(JComponent.java:961) at java.desktop/javax.swing.JComponent.paint(JComponent.java:1137) at java.desktop/javax.swing.JLayeredPane.paint(JLayeredPane.java:586) at java.desktop/javax.swing.JComponent.paintChildren(JComponent.java:961) at java.desktop/javax.swing.JComponent.paintToOffscreen(JComponent.java:5325) at java.desktop/javax.swing.RepaintManager$PaintManager.paintDoubleBufferedImpl(RepaintManager.java:1656) at java.desktop/javax.swing.RepaintManager$PaintManager.paintDoubleBuffered(RepaintManager.java:1631) at java.desktop/javax.swing.RepaintManager$PaintManager.paint(RepaintManager.java:1569) at java.desktop/javax.swing.RepaintManager.paint(RepaintManager.java:1336) at java.desktop/javax.swing.JComponent.paint(JComponent.java:1114) at java.desktop/java.awt.GraphicsCallback$PaintCallback.run(GraphicsCallback.java:39) at java.desktop/sun.awt.SunGraphicsCallback.runOneComponent(SunGraphicsCallback.java:75) at java.desktop/sun.awt.SunGraphicsCallback.runComponents(SunGraphicsCallback.java:112) at java.desktop/java.awt.Container.paint(Container.java:2005) at java.desktop/java.awt.Window.paint(Window.java:3959) at java.desktop/javax.swing.RepaintManager$4.run(RepaintManager.java:889) at java.desktop/javax.swing.RepaintManager$4.run(RepaintManager.java:861) at java.base/java.security.AccessController.doPrivileged(AccessController.java:400) at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:87) at java.desktop/javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:861) at java.desktop/javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:834) at java.desktop/javax.swing.RepaintManager.prePaintDirtyRegions(RepaintManager.java:784) at java.desktop/javax.swing.RepaintManager$ProcessingRunnable.run(RepaintManager.java:1897) at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:318) at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:773) at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:720) at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:714) at java.base/java.security.AccessController.doPrivileged(AccessController.java:400) at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:87) at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:742) 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.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)