Revivius / nb-darcula

Darcula LAF for NetBeans
277 stars 83 forks source link

NullPointerException: Colors cannot be null #107

Open entlicher opened 8 years ago

entlicher commented 8 years ago

We have a report in NetBeans Bugzilla about a NPE when using darcula: https://netbeans.org/bugzilla/show_bug.cgi?id=258553

Stacktrace: java.lang.NullPointerException: Colors cannot be null at java.awt.GradientPaint.(GradientPaint.java:90) at com.revivius.nb.darcula.ui.ContentAreaAwareToggleButtonUI.getBackgroundPaint(ContentAreaAwareToggleButtonUI.java:34) at com.revivius.nb.darcula.ui.ContentAreaAwareButtonUI.paint(ContentAreaAwareButtonUI.java:56) at javax.swing.plaf.ComponentUI.update(ComponentUI.java:161) at com.revivius.nb.darcula.ui.ContentAreaAwareButtonUI.update(ContentAreaAwareButtonUI.java:115) at com.revivius.nb.darcula.ui.ContentAreaAwareToggleButtonUI.update(ContentAreaAwareToggleButtonUI.java:42)

Revivius commented 8 years ago

@entlicher,@everflux; I can not reproduce the issue. Can you please give me the steps ?

everflux commented 8 years ago

I can tell you that I am using Ubuntu 16.04 Gnome, but I have no idea what triggered the bug.

markiewb commented 8 years ago

@Revivius: Regarding the code UIManager.getColor("Button.darcula.color1") or UIManager.getColor("Button.darcula.color2") is null

Please make com.revivius.nb.darcula.ui.ContentAreaAwareToggleButtonUI NPE safe, when colors are not set in UIManager.