Prevent null string return from causing undefined behavior.