[PR #15336] [MERGED] Fix theoretical new-tab file drop crash #30599

Open
opened 2026-01-31 09:41:47 +00:00 by claunia · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/microsoft/terminal/pull/15336
Author: @lhecker
Created: 5/12/2023
Status: Merged
Merged: 5/12/2023
Merged by: @DHowett

Base: mainHead: dev/lhecker/terminal-drop-crash


📝 Commits (1)

  • 5e3d6b3 Fix theoretical new-tab file drop crash

📊 Changes

2 files changed (+31 additions, -25 deletions)

View changed files

📝 src/cascadia/TerminalApp/TerminalPage.cpp (+29 -23)
📝 src/cascadia/TerminalApp/TerminalPage.h (+2 -2)

📄 Description

After retrieving the items via GetStorageItemsAsync() inside a try
clause it fails to check if the pointer is actually non-null.
Apart from this this commit fixes the unsafe use of this by properly
using get_weak(). Finally it allows >1 paths to be dropped.

Validation Steps Performed

  • Dropping >1 file works
  • Dropping >1 directory works

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/microsoft/terminal/pull/15336 **Author:** [@lhecker](https://github.com/lhecker) **Created:** 5/12/2023 **Status:** ✅ Merged **Merged:** 5/12/2023 **Merged by:** [@DHowett](https://github.com/DHowett) **Base:** `main` ← **Head:** `dev/lhecker/terminal-drop-crash` --- ### 📝 Commits (1) - [`5e3d6b3`](https://github.com/microsoft/terminal/commit/5e3d6b3ba86b0d083a8419835d67f5bc12e456cc) Fix theoretical new-tab file drop crash ### 📊 Changes **2 files changed** (+31 additions, -25 deletions) <details> <summary>View changed files</summary> 📝 `src/cascadia/TerminalApp/TerminalPage.cpp` (+29 -23) 📝 `src/cascadia/TerminalApp/TerminalPage.h` (+2 -2) </details> ### 📄 Description After retrieving the items via `GetStorageItemsAsync()` inside a try clause it fails to check if the pointer is actually non-null. Apart from this this commit fixes the unsafe use of `this` by properly using `get_weak()`. Finally it allows >1 paths to be dropped. ## Validation Steps Performed * Dropping >1 file works ✅ * Dropping >1 directory works ✅ --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
claunia added the pull-request label 2026-01-31 09:41:47 +00:00
Sign in to join this conversation.
No Label pull-request
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#30599