*if not nil* is the the same as `if <thing>`. I don't think you needed to make this change.