[PR #14678] [MERGED] [WPF] Add TermCore null checks to HwndTerminal #30210

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

📋 Pull Request Information

Original PR: https://github.com/microsoft/terminal/pull/14678
Author: @carlos-zamora
Created: 1/13/2023
Status: Merged
Merged: 1/13/2023
Merged by: @undefined

Base: mainHead: dev/cazamor/wpf-null-checks


📝 Commits (2)

  • 6b31cee [WPF] Add TermCore null checks to HwndTerminal
  • 1d2e78c static analysis

📊 Changes

1 file changed (+68 additions, -10 deletions)

View changed files

📝 src/cascadia/PublicTerminalCore/HwndTerminal.cpp (+68 -10)

📄 Description

#14461 is caused by a null pointer exception in TerminalIsSelectionActive(). Since this reveals that it is possible to enter a state where _terminal is null, I've gone ahead and added null-checks throughout the code to make it more stable.

Closes #14461

Validation Steps Performed

Ran locally. Still 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/14678 **Author:** [@carlos-zamora](https://github.com/carlos-zamora) **Created:** 1/13/2023 **Status:** ✅ Merged **Merged:** 1/13/2023 **Merged by:** [@undefined](undefined) **Base:** `main` ← **Head:** `dev/cazamor/wpf-null-checks` --- ### 📝 Commits (2) - [`6b31cee`](https://github.com/microsoft/terminal/commit/6b31cee11bb5a1b69405b1e137d030c1104deb32) [WPF] Add TermCore null checks to HwndTerminal - [`1d2e78c`](https://github.com/microsoft/terminal/commit/1d2e78cdf6b07040cc10f5f369f66f994a9ffd0c) static analysis ### 📊 Changes **1 file changed** (+68 additions, -10 deletions) <details> <summary>View changed files</summary> 📝 `src/cascadia/PublicTerminalCore/HwndTerminal.cpp` (+68 -10) </details> ### 📄 Description #14461 is caused by a null pointer exception in `TerminalIsSelectionActive()`. Since this reveals that it is possible to enter a state where `_terminal` is null, I've gone ahead and added null-checks throughout the code to make it more stable. Closes #14461 ## Validation Steps Performed Ran locally. Still 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:39:21 +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#30210