You just checked that str was nil.  No need for the "str and str:len()" as you know that will be false.

This line should be changed to:

check.status("could not read banner")

or something like that.