check if string is nil
raise exception if string is nil