Fixed bug in withNameRegex and firstWithNameRegex when name is null

This is a small bug fix for the functions withNameRegex and firstWithNameRegex.

When there are elements in the iterated array where the name is null, I got the following error:
TypeError: undefined is not a function (evaluating 'elem.name().match')

So I included a check if the name exists by calling the name() function as an additional condition.