Fix issue #1
Add typeof verification to the string to avoid crash when receiving null