coverity#1169826 Dereference after null check

Change-Id: Ie431672b5a6ba1d613ae1cb9e48fa6d1db6a6b4a
(cherry picked from commit 57e0062f2043f7a0382db5f4d01c6c70ca8aca46)
Reviewed-on: https://gerrit.libreoffice.org/7953
Tested-by: Andrzej Hunt <andrzej.hunt@collabora.com>
Reviewed-by: Andrzej Hunt <andrzej.hunt@collabora.com>