From 8d4fd4ebb6579f4f7004cb4c5a53b9e365b6cd41 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Thu, 11 Apr 2024 19:26:13 +0200 Subject: [PATCH] Fix setting view type attribute on Tab Set nothing if there is no current tab and use the correct attribute to retrieve the current view type. Closes #13192 --- sao/src/screen.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sao/src/screen.js b/sao/src/screen.js index c5fd89dd68..481bb6b347 100644 --- a/sao/src/screen.js +++ b/sao/src/screen.js @@ -981,8 +981,8 @@ if (this.switch_callback) { this.switch_callback(); } - Sao.Tab.set_view_type( - Sao.Tab.tabs.get_current().view_type); + const tab = Sao.Tab.tabs.get_current(); + Sao.Tab.set_view_type(tab ? tab.current_view_type : null); }); }; const set_current_view = () => {