adding NULL pointer protection and safe string operation

No match.