So I am pushing some elements on my array like this:

```
upd_city_list << [ j.children[0].text.strip!.gsub(/\s+\W/, ''), j.children[1].text, j.children[1][:href] ]

```

The above is in an iterator (hence the use of `j`).

The issue is that from time to time, the `j.children[0].text` turns up as `nil`, and Ruby doesn't like that.

I could add a bunch of if statements before this assignment, but that seems a bit inelegant to me.

How do I handle nil cases in this situation in an elegant way?

One possible solution is, when there is a nil value, just push the string `none` onto the array....but what would that look like?

Thanks.

Edit1:

This is the error I am getting:

```
NoMethodError: private method ‘gsub’ called for nil:NilClass

```