[Libreoffice-commits] core.git: wizards/com
Caolán McNamara
caolanm at redhat.com
Tue Mar 1 10:33:23 UTC 2016
wizards/com/sun/star/wizards/document/GridControl.java | 6 ++++++
1 file changed, 6 insertions(+)
New commits:
commit 144ce8b3ff38a39507a4167662ef5b4aec63907a
Author: Caolán McNamara <caolanm at redhat.com>
Date: Tue Mar 1 10:32:30 2016 +0000
coverity#1326304 Explicit null dereferenced
Change-Id: I1fba88431ec7e5154f39bb0c76e622c6129011d2
diff --git a/wizards/com/sun/star/wizards/document/GridControl.java b/wizards/com/sun/star/wizards/document/GridControl.java
index 4b8f98d..cca5de9 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);
More information about the Libreoffice-commits
mailing list