This is an automated email from the ASF dual-hosted git repository.
matthiasblaesing pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans.git
The following commit(s) were added to refs/heads/master by this push:
new cf1bd51 Popupswitcher npe fixes (#1219)
cf1bd51 is described below
commit cf1bd51421d6cccdeb8bce079eb59544c0c4da25
Author: Tim Boudreau <[email protected]>
AuthorDate: Sat Apr 27 07:27:57 2019 -0400
Popupswitcher npe fixes (#1219)
* Fix two rare but annoying NPEs from popup switcher
* Update spec version
---
.../src/org/netbeans/swing/tabcontrol/ButtonPopupSwitcher.java | 4 +++-
.../src/org/netbeans/swing/tabcontrol/DocumentSwitcherTable.java | 2 +-
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git
a/platform/o.n.swing.tabcontrol/src/org/netbeans/swing/tabcontrol/ButtonPopupSwitcher.java
b/platform/o.n.swing.tabcontrol/src/org/netbeans/swing/tabcontrol/ButtonPopupSwitcher.java
index 25a3443..c357cab 100644
---
a/platform/o.n.swing.tabcontrol/src/org/netbeans/swing/tabcontrol/ButtonPopupSwitcher.java
+++
b/platform/o.n.swing.tabcontrol/src/org/netbeans/swing/tabcontrol/ButtonPopupSwitcher.java
@@ -186,7 +186,9 @@ final class ButtonPopupSwitcher implements
MouseInputListener, AWTEventListener,
@Override
public void valueChanged( ListSelectionEvent e ) {
SwitcherTableItem item = pTable.getSelectedItem();
- StatusDisplayer.getDefault().setStatusText( null == item ? null :
item.getDescription() );
+ if (item != null) {
+ StatusDisplayer.getDefault().setStatusText( item.getDescription()
);
+ }
}
@Override
diff --git
a/platform/o.n.swing.tabcontrol/src/org/netbeans/swing/tabcontrol/DocumentSwitcherTable.java
b/platform/o.n.swing.tabcontrol/src/org/netbeans/swing/tabcontrol/DocumentSwitcherTable.java
index 11ee0ff..528961b 100644
---
a/platform/o.n.swing.tabcontrol/src/org/netbeans/swing/tabcontrol/DocumentSwitcherTable.java
+++
b/platform/o.n.swing.tabcontrol/src/org/netbeans/swing/tabcontrol/DocumentSwitcherTable.java
@@ -163,7 +163,7 @@ class DocumentSwitcherTable extends SwitcherTable {
}
boolean isClosable( Item item ) {
- if( !SHOW_CLOSE_BUTTON )
+ if( !SHOW_CLOSE_BUTTON || item == null)
return false;
WinsysInfoForTabbedContainer winsysInfo =
displayer.getContainerWinsysInfo();
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists