coverity#705966 Dereference before null check

Change-Id: I74507ce67f928bdeb626d4070dbd2a45cc126521
(cherry picked from commit 511d8bbbec6bc95d92a3ac6bbac4c68622738706)
Reviewed-on: https://gerrit.libreoffice.org/8697
Reviewed-by: Norbert Thiebaud <nthiebaud@gmail.com>
Tested-by: Norbert Thiebaud <nthiebaud@gmail.com>