Fix crash when switching between QuickLook preview and text view