coverity#705969 Dereference before null check

Change-Id: Icb19931bb529e6c2b98621a603cdb86011d68a9e
(cherry picked from commit 51452b7afe858139076010decbe04758321a8396)
Reviewed-on: https://gerrit.libreoffice.org/8733
Tested-by: Björn Michaelsen <bjoern.michaelsen@canonical.com>
Reviewed-by: Björn Michaelsen <bjoern.michaelsen@canonical.com>