coverity#1158240 Dereference before null check

Change-Id: I5ce6d5514c6bb2298dd00c43d21a43dba55268c3
(cherry picked from commit 6c7b64bad403fb6eeac6e79d356f456f741a00d4)
Reviewed-on: https://gerrit.libreoffice.org/10139
Reviewed-by: Michael Stahl <mstahl@redhat.com>
Tested-by: Michael Stahl <mstahl@redhat.com>