Added null and empty list checking in ListInventoryBuilder so that MySQL error is not encountered for empty lists

Issue: GCP-9216

Reviewer: Aldrin (post-commit)