Throw an exception is inventory is bad or if items are null.