Only use array keys if it is an array

Was getting a warning about $va_items not being an array. I looked at $po_instance->getRelatedItems() and that can return null, so this covers that case.