Resolves: rhbz#1096486 avoid access to nonexisting parent dialog

was Related: rhbz#1047174

(cherry picked from commit 794f5af121906668870a58700aed25b660381240)

Change-Id: I0bf9116d088adde838993ac5e909a6f3481f883e
Reviewed-on: https://gerrit.libreoffice.org/9326
Reviewed-by: Eike Rathke <erack@redhat.com>
Tested-by: Eike Rathke <erack@redhat.com>