check for empty slots' valid NULL pointer, fdo#79441

Change-Id: Ie81b8b00c1ab8776086bddeb7464bb7809914bf8
(cherry picked from commit 2be9ae72189e8b86d7e609727bab223645975ddb)
Reviewed-on: https://gerrit.libreoffice.org/11258
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>