diff options
author | Caolán McNamara <caolanm@redhat.com> | 2017-04-30 15:30:00 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2017-04-30 15:30:00 +0100 |
commit | ccef4d977b87c470340dfc89ab590d718804f297 (patch) | |
tree | 47f4a237fb6752149f3e9a629fedf6f58a5b4169 /wizards | |
parent | e0828cf746b1dcca7a1835f0fdb46cba83c8b589 (diff) |
coverity#1405739 Explicit null dereferenced
Change-Id: If12d46d49936af3a91b2d50ca8fca43596eb4ae5
Diffstat (limited to 'wizards')
-rw-r--r-- | wizards/com/sun/star/wizards/ui/ButtonList.java | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/wizards/com/sun/star/wizards/ui/ButtonList.java b/wizards/com/sun/star/wizards/ui/ButtonList.java index 447a7d1325e4..522768bf8c07 100644 --- a/wizards/com/sun/star/wizards/ui/ButtonList.java +++ b/wizards/com/sun/star/wizards/ui/ButtonList.java @@ -464,14 +464,19 @@ public class ButtonList implements XItemEventBroadcaster, XActionListener fireItemSelected(); } - /** * set the text under the button list */ private void refreshImageText() { + String sText; Object item = m_nCurrentSelection >= 0 ? getListModel().getElementAt(m_nCurrentSelection) : null; - final String sText = PropertyNames.SPACE + renderer.render(item); + if (item != null) { + sText = PropertyNames.SPACE + renderer.render(item); + } + else { + sText = ""; + } Helper.setUnoPropertyValue(getModel(lblImageText), PropertyNames.PROPERTY_LABEL, sText); } |