diff options
author | Caolán McNamara <caolanm@redhat.com> | 2015-10-22 09:12:37 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2015-10-22 16:45:05 +0100 |
commit | f86c07afd733234a2653325df0f165c0dfeaf716 (patch) | |
tree | b5eb4f1080be0073638c87b9cbaa2bc6857e0819 /wizards | |
parent | c4e1857dc034d38900f8a7ef0a10814911e91e59 (diff) |
coverity#1326381 Dereference null return value
Change-Id: I86f5fee9bd77b741536816b6b4d1b6b520acba9e
Diffstat (limited to 'wizards')
-rw-r--r-- | wizards/com/sun/star/wizards/ui/ButtonList.java | 34 |
1 files changed, 18 insertions, 16 deletions
diff --git a/wizards/com/sun/star/wizards/ui/ButtonList.java b/wizards/com/sun/star/wizards/ui/ButtonList.java index 9e6f365fa3fa..b0624c907583 100644 --- a/wizards/com/sun/star/wizards/ui/ButtonList.java +++ b/wizards/com/sun/star/wizards/ui/ButtonList.java @@ -285,23 +285,25 @@ public class ButtonList implements XItemEventBroadcaster, XActionListener } for (int i = 0; i < m_aButtons.length; i++) { - Object[] oResources = renderer.getImageUrls(getObjectFor(i)); - if (oResources != null) + Object oObj = getObjectFor(i); + if (oObj == null) + continue; + Object[] oResources = renderer.getImageUrls(oObj); + if (oResources == null) + continue; + if (oResources.length == 1) { - if (oResources.length == 1) - { - Helper.setUnoPropertyValue(m_aButtons[i].getModel(), PropertyNames.PROPERTY_IMAGEURL, oResources[0]); - } - else if (oResources.length == 2) - { - oUnoDialog.getPeerConfiguration().setImageUrl(m_aButtons[i].getModel(), oResources[0], oResources[1]); - } - boolean bTabStop = Boolean.TRUE; // focusable ? Boolean.TRUE : Boolean.FALSE; - Helper.setUnoPropertyValue(m_aButtons[i].getModel(), "Tabstop", bTabStop); - if (refreshOverNull) - { - setVisible(m_aButtons[i], true); - } + Helper.setUnoPropertyValue(m_aButtons[i].getModel(), PropertyNames.PROPERTY_IMAGEURL, oResources[0]); + } + else if (oResources.length == 2) + { + oUnoDialog.getPeerConfiguration().setImageUrl(m_aButtons[i].getModel(), oResources[0], oResources[1]); + } + boolean bTabStop = Boolean.TRUE; // focusable ? Boolean.TRUE : Boolean.FALSE; + Helper.setUnoPropertyValue(m_aButtons[i].getModel(), "Tabstop", bTabStop); + if (refreshOverNull) + { + setVisible(m_aButtons[i], true); } } } |