patch 9.1.1411: crash when calling non-existing function for tabpanel

Problem:  crash when calling non-existing function for tabpanel (Yamagi,
          after v9.1.1391)
Solution: check if there was an error and if there was, set tabpanel
          option to empty to prevent showing errors on every redraw

fixes: #17364
closes: #17375
closes: #17371

Signed-off-by: Christian Brabandt <cb@256bit.org>
diff --git a/src/testdir/test_tabpanel.vim b/src/testdir/test_tabpanel.vim
index c67166e..6aaae63 100644
--- a/src/testdir/test_tabpanel.vim
+++ b/src/testdir/test_tabpanel.vim
@@ -521,4 +521,16 @@
   call StopVimInTerminal(buf)
 endfunc
 
+function Test_tabpanel_error()
+  set tabpanel=%!NonExistingFunc()
+  try
+    set showtabpanel=2
+    redraw!
+  catch /^Vim\%((\a\+)\)\=:E117:/
+  endtry
+  call assert_true(empty(&tabpanel))
+  set tabpanel&vim
+  set showtabpanel&vim
+endfunc
+
 " vim: shiftwidth=2 sts=2 expandtab