Fix crash in GetCurrentTab