Prevent casting null as empty string