coverity#704633 Dereference after null check

(cherry picked from commit ccf0f7ef03bf98831a3e21b4b1327673a590b918)

Change-Id: I4985249110da93ba67881dcd1c8cd1dc66ae08e2
Reviewed-on: https://gerrit.libreoffice.org/8379
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>