After a while of playing I'm getting exactly the same error message when I try to swap weapons.
It fails at this line of InventorySlot.lua:
Code:
local controlType = inventorySlot:GetType()
In other words, tooltip is not attached to valid inventory slot. So, probably it is caused by some addon that modifies tooltips (ItemTooltip).
In my case this slash command fixes the error message:
Code:
/script ComparativeTooltip1:SetHidden(true)
Now to find which addon does not hide ComparativeTooltip1 when it should be hidden. My guess is either CraftCompare or InventoryInsight, but I still do not know which one it is.