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>
This commit is contained in:
Caolán McNamara 2021-03-25 13:11:58 +00:00
parent 1bad470976
commit b4a741291d

View file

@ -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 ) {}