Shared/database: fix empty errors being used or displayed in some cases.