Added check for Null

If Else for Null/Empty