Return empty string when passed null or invalid IDs/hashes