coverity#1202882 Dereference before null check

Change-Id: Ie61df08c11b687c0b4a3ae212b3f9a6c95171396
(cherry picked from commit c152349f69acfb6bb873ed1cd12ca1b6dc325f1f)
Reviewed-on: https://gerrit.libreoffice.org/9095
Tested-by: Andrzej Hunt <andrzej.hunt@collabora.com>
Reviewed-by: Andrzej Hunt <andrzej.hunt@collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/9133
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>