Rewrite else part to avoid compiler warning

The logic is using an size_t to count the number of items
in a list, and then does the following logic:

if (more than one)
else if (only one)
else if (empty)

This generates a warnign about that another variable is not
initialized if none of the above is true. There is no way
the number items may be negative (unless the size_t is
a signed variable that wraps around). Changed the code to just
use an else branch and assert that the number of items is 0.

Change-Id: I98985fecf7831053c22dd6bb314e2b0079a88788