Fix portal error on empty database