fixed a NPE in the shader node editor when the navigator panel is collapsed

This commit is contained in:
Rémy Bouquet 2015-07-18 21:49:27 +02:00
parent 45321fc7d5
commit c348e30188

View File

@ -272,6 +272,11 @@ public final class MatDefEditorlElement extends JPanel implements MultiViewEleme
protected void selectionChanged(Selectable selectable) { protected void selectionChanged(Selectable selectable) {
MatDefNavigatorPanel nav = obj.getLookup().lookup(MatDefNavigatorPanel.class); MatDefNavigatorPanel nav = obj.getLookup().lookup(MatDefNavigatorPanel.class);
//It's possible that the navigator is null if it's collapsed in the ui.
//In that case we early return to avoid further issues
if(nav == null){
return;
}
try { try {
Node n = findNode(nav.getExplorerManager().getRootContext(), selectable.getKey()); Node n = findNode(nav.getExplorerManager().getRootContext(), selectable.getKey());
if (n == null) { if (n == null) {