Problem while getting player inventory

Hello,
I was triying to make a inventory reader when I found this error:
image
This is the code:

			local AvatarPromptResult = AvatarEditorS.PromptAllowInventoryReadAccessCompleted:Wait()
			if AvatarPromptResult == Enum.AvatarPromptResult.Success then
				local InventoryPages = AvatarEditorS:GetInventory(Enum.AvatarAssetType.Face, Enum.AvatarAssetType.Head, Enum.AvatarAssetType.Hat, Enum.AvatarAssetType.Torso, Enum.AvatarAssetType.Shirt, Enum.AvatarAssetType.Pants, Enum.AvatarAssetType.Shirt, Enum.AvatarAssetType.Gear, Enum.AvatarAssetType.HairAccessory, Enum.AvatarAssetType.TShirt, Enum.AvatarAssetType.FallAnimation, Enum.AvatarAssetType.EmoteAnimation, Enum.AvatarAssetType.LeftArm, Enum.AvatarAssetType.RightLeg, Enum.AvatarAssetType.RightArm, Enum.AvatarAssetType.DynamicHead, Enum.AvatarAssetType.RunAnimation, Enum.AvatarAssetType.BackAccessory, Enum.AvatarAssetType.IdleAnimation, Enum.AvatarAssetType.EmoteAnimation, Enum.AvatarAssetType.FaceAccessory, Enum.AvatarAssetType.ShortsAccessory, Enum.AvatarAssetType.FrontAccessory, Enum.AvatarAssetType.WaistAccessory)
				while true do
					for i, data in pairs(InventoryPages:GetCurrentPage()) do
						print(data.key, data.value)
					end					
					if InventoryPages.IsFinished then
						break
					end
					InventoryPages:AdvanceToNextPageAsync()
				end
			end

I tried to fix it searching it on Google but I didn’t found any satisfactory result, can someone help me?