You guessed correctly that as long as the length operation is non-zero it's evaluated as true. These types of errors are like that. Just like you see what you intended to type rather than what's on the screen.