diff options
author | Caolán McNamara <caolanm@redhat.com> | 2021-03-25 13:11:58 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2021-03-25 15:46:43 +0100 |
commit | b4a741291d609a422f0e870ac7cd0668e8dbd0be (patch) | |
tree | 35b509ef363d556b5f7d4a0f89de0c60ee108c2a | |
parent | 1bad47097694de957857c9c891bf79a4873a97c4 (diff) |
cid#1473991 Dereference null return value
Change-Id: I11d9d685a278d31f591927b67637e9224a99fb27
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113096
Tested-by: Caolán McNamara <caolanm@redhat.com>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r-- | bean/com/sun/star/comp/beans/OOoBean.java | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/bean/com/sun/star/comp/beans/OOoBean.java b/bean/com/sun/star/comp/beans/OOoBean.java index ca9442d58427..05b5288ea528 100644 --- a/bean/com/sun/star/comp/beans/OOoBean.java +++ b/bean/com/sun/star/comp/beans/OOoBean.java @@ -1405,10 +1405,9 @@ xLayoutManager.showElement("private:resource/menubar/menubar"); iConnection.addEventListener( this ); // listen on a terminating OOo - try { - getOOoDesktop().addTerminateListener( this ); - } - catch ( Throwable aExc ) {} + com.sun.star.frame.XDesktop xDesktop = getOOoDesktop(); + if (xDesktop != null) + xDesktop.addTerminateListener( this ); // start this thread as a daemon setDaemon( true ); @@ -1425,7 +1424,9 @@ xLayoutManager.showElement("private:resource/menubar/menubar"); // do not listen on a terminating OOo anymore try { - getOOoDesktop().removeTerminateListener( this ); + com.sun.star.frame.XDesktop xDesktop = getOOoDesktop(); + if (xDesktop != null) + xDesktop.removeTerminateListener( this ); } catch ( Throwable aExc ) {} |