Skip to content

Commit 7c57ba5

Browse files
moovidazglueck
authored andcommitted
This small fix solves a NPE in cases in which a look&feel has been set. (#10)
* fix for case with theme set, which was causing a NPE * code format and documentation
1 parent 2f33a93 commit 7c57ba5

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/gov/nasa/worldwind/awt/WorldWindowGLJPanel.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,8 @@ public Object removeKey(String key)
367367
public synchronized void addPropertyChangeListener(PropertyChangeListener listener)
368368
{
369369
super.addPropertyChangeListener(listener);
370-
this.wwd.addPropertyChangeListener(listener);
370+
if (wwd != null) // defensive condition for NPE that happens when (for example) setting a swing look/feel
371+
this.wwd.addPropertyChangeListener(listener);
371372
}
372373

373374
@Override

0 commit comments

Comments
 (0)