check for empty m_aStates

valgrind + bff

Change-Id: Ib818d508e10877a845b733c4aa223d1e2cbbc05e
(cherry picked from commit e2b9531e43d37677109aa13eb6e2ebf857961016)
Reviewed-on: https://gerrit.libreoffice.org/10959
Reviewed-by: David Tardon <dtardon@redhat.com>
Tested-by: David Tardon <dtardon@redhat.com>