Ruby

Ruby

Made by DeepSource

Safe navigation used with blank? RB-RL1050

Bug risk
Major

While the safe navigation operator is generally a good idea, when checking foo&.blank? in a conditional, foo being nil will actually do the opposite of what was intended.

Bad practice

do_something if foo&.blank?

Recommended

do_something if foo.blank?