prevent undefined method `empty?' for nil:NilClass

prevent undefined method `empty?' for nil:NilClass