Fixed NoMethodError: undefined method `gsub!' for nil:NilClass error

Fixed our most common production error:

````
NoMethodError: undefined method `gsub!' for nil:NilClass
````