Don't go further and pop the stack if it's empty.

Change-Id: I27bd30ca65cf0066cd022b4b060757913ea01fed
(cherry picked from commit 3ede68e1cc879e6adbf6336eccaf88ced974b8b6)
Reviewed-on: https://gerrit.libreoffice.org/9988
Tested-by: Michael Stahl <mstahl@redhat.com>
Reviewed-by: Michael Stahl <mstahl@redhat.com>