summaryrefslogtreecommitdiff
path: root/wizards/com/sun/star
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2016-03-01 10:32:30 +0000
committerCaolán McNamara <caolanm@redhat.com>2016-03-01 10:32:30 +0000
commit144ce8b3ff38a39507a4167662ef5b4aec63907a (patch)
treea920994901d67fe4769fb5082dc9092eb631ee5f /wizards/com/sun/star
parentd112040b7f91415a4f58b9e1a7bd84bd5c914c81 (diff)
coverity#1326304 Explicit null dereferenced
Change-Id: I1fba88431ec7e5154f39bb0c76e622c6129011d2
Diffstat (limited to 'wizards/com/sun/star')
-rw-r--r--wizards/com/sun/star/wizards/document/GridControl.java6
1 files changed, 6 insertions, 0 deletions
diff --git a/wizards/com/sun/star/wizards/document/GridControl.java b/wizards/com/sun/star/wizards/document/GridControl.java
index 4b8f98dba2a3..cca5de994cae 100644
--- a/wizards/com/sun/star/wizards/document/GridControl.java
+++ b/wizards/com/sun/star/wizards/document/GridControl.java
@@ -51,6 +51,12 @@ public class GridControl extends Shape
xNameAccess = UnoRuntime.queryInterface( XNameAccess.class, oGridModel );
_xFormName.insertByName(_sname, oGridModel);
XControlModel xControlModel = UnoRuntime.queryInterface( XControlModel.class, oGridModel );
+ // test if the interface was available
+ if (xControlModel == null) {
+ throw new Exception(
+ "Error: GridModel does not export XControlModel interface");
+ }
+
xControlShape.setControl(xControlModel);
xPropertySet = UnoRuntime.queryInterface( XPropertySet.class, oGridModel );
oFormHandler.xDrawPage.add(xShape);