Coverity: Potential crash (?)

Change-Id: I819b0df446cf95d511d6a7a5a65c381a2a837d00
(cherry picked from commit 7989850e9fc5fb2fb757ecf388b51bc3e96a0267)
Reviewed-on: https://gerrit.libreoffice.org/7563
Reviewed-by: David Tardon <dtardon@redhat.com>
Tested-by: David Tardon <dtardon@redhat.com>
Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>