diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2023-04-18 15:06:49 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2023-04-18 16:31:04 +0200 |
commit | 4b3308a8c24d71c30145c93411fab12c66660b5e (patch) | |
tree | 19377e3ff81905b7fbc570c0578f466c5e8d8ce9 /scripting | |
parent | 77441b237db98d6577c8799c0c636839855c5c52 (diff) |
Avoid NullPointerException
...when dispose is called without a preceding call to initialize (as would
happen with an improved CppunitTest_services)
Change-Id: Ic632d736ecb27509b092ef526cf0dfc964023663
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150576
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'scripting')
-rw-r--r-- | scripting/java/Framework/com/sun/star/script/framework/security/SecurityDialog.java | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/scripting/java/Framework/com/sun/star/script/framework/security/SecurityDialog.java b/scripting/java/Framework/com/sun/star/script/framework/security/SecurityDialog.java index 078f63395384..dcef62d86077 100644 --- a/scripting/java/Framework/com/sun/star/script/framework/security/SecurityDialog.java +++ b/scripting/java/Framework/com/sun/star/script/framework/security/SecurityDialog.java @@ -515,10 +515,12 @@ public class SecurityDialog extends WeakBase implements public void dispose() { - XComponent xComponent = - UnoRuntime.queryInterface(XComponent.class, _xDialog); + if (_xDialog != null) { + XComponent xComponent = + UnoRuntime.queryInterface(XComponent.class, _xDialog); - xComponent.dispose(); + xComponent.dispose(); + } } public void addEventListener(com.sun.star.lang.XEventListener xListener) { |