jaycode
jaycode

Reputation: 2958

can't dup NilClass when using Sanitize gem

Alright this probably is the worst error I have found ever.

I have two projects, both using same code:

Sanitize.clean(string, Sanitize::Config::BASIC)

but one works and another fails.

Problem is similar to this poor guy's post: https://stackoverflow.com/questions/2724342/cant-dup-nilclass-how-to-trace-to-offender

Could anybody help please?

Upvotes: 1

Views: 311

Answers (1)

jaycode
jaycode

Reputation: 2958

This will happen if you pass nil into clean() instead of a string. Make sure your string variable is really a string.

Upvotes: 2

Related Questions