Repository: microsoft/terminal (language: cpp)

Issue:
Using "Split tab" on the right-click context menu causes terminal to crash
v1.21.1011.0


Discussion / hints:
(almost certainly the same as #17075)
It crashes when you want to duplicate tabs as well.


https://github.com/microsoft/terminal/assets/89489853/9d941343-042e-40ff-9dbb-0e89e364f601



Fix patch:
diff --git a/src/cascadia/TerminalApp/TerminalPage.cpp b/src/cascadia/TerminalApp/TerminalPage.cpp
index b10e2157c1b..3a82a05aebf 100644
--- a/src/cascadia/TerminalApp/TerminalPage.cpp
+++ b/src/cascadia/TerminalApp/TerminalPage.cpp
@@ -3152,7 +3152,8 @@ namespace winrt::TerminalApp::implementation
                                                   TerminalConnection::ITerminalConnection existingConnection)
 
     {
-        if (const auto& newTerminalArgs{ contentArgs.try_as<NewTerminalArgs>() })
+        const auto& newTerminalArgs{ contentArgs.try_as<NewTerminalArgs>() };
+        if (contentArgs == nullptr || newTerminalArgs != nullptr || contentArgs.Type().empty())
         {
             // Terminals are of course special, and have to deal with debug taps, duplicating the tab, etc.
             return _MakeTerminalPane(newTerminalArgs, sourceTab, existingConnection);


Test patch: