I have a very simple method that checks if a string ends with one of a list of disallowed endings, the value might be nil or empty. I have a check for this, but i still keeps getting the error below, should my if not catch that case?
It is Ruby 1.9.

```
NoMethodError:
       undefined method `end_with?' for nil:NilClass

```

The Code

```
private
def self.validate_ending(value)
    disallowedEndings = [", the", ", a ", ", an", ", das", ", die", ", der", ", ein"]
    if value.nil? || value.empty?
        false
    end
    for s in disallowedEndings
        if value.end_with?(s)
            true
        end
    end
    false
end

```