I think I suggested that at some point. I was pretty completely certain that a search object was returned even if the search was not successful, but indeed seacrh returns None in that case. So yes, I think your suggested change should be safe.