check for empty string before accessing first element

E.g. fdo#64530-1.xlsx

Change-Id: Iff2d026f6e876ab76c9b89b8200413d6c3a7a0e3
Reviewed-on: https://gerrit.libreoffice.org/9717
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>