[PATCH 3/6] treewide: fix incorrect use to determine if list is empty