rapid7/metasploit-framework — comment on commit 3fe076bcd66fc89def6bc95ea3cecd3c5e25bbd7
File:  line 0
By todb-r7:

Is there any reason at all to not simply monkeypatch NilClass? This class of error comes up a lot, and can be avoided with:

class NilClass; def empty?; true; end; end

I can't think of any String#empty?() or Array#empty?() or Hash#empty?() test where this wouldn't be expected behavior if you get a nil.

In fact, I'll open a pull request for it, just to see if anyone shoots it down.