fix crash cause by string(null).
Merge pull request #5137 from Dhilan007/develop_crash

fix crash cause by string(null).