A list with a length of zero still evaluates to true, so check length == 0 instead