scripts/karma: handle empty database in popular/unpopular