1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-06-07 17:56:01 +02:00

Add a missing null check since terminal properties can be null (#620)

Removes a redundant map lookup too.

Fixes #617
This commit is contained in:
Jonah Graham 2023-11-14 18:24:29 -05:00 committed by GitHub
parent 9ba721566d
commit 050770d37a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -127,15 +127,13 @@ public class TabTerminalListener implements ITerminalListener3 {
// Get the original terminal properties associated with the tab item
@SuppressWarnings({ "unchecked" })
final Map<String, Object> properties = (Map<String, Object>) item.getData("properties"); //$NON-NLS-1$
if (properties.containsKey(ITerminalsConnectorConstants.PROP_TITLE_DISABLE_ANSI_TITLE)) {
if (properties.get(
ITerminalsConnectorConstants.PROP_TITLE_DISABLE_ANSI_TITLE) instanceof Boolean disableAnsi) {
if (properties != null && properties
.get(ITerminalsConnectorConstants.PROP_TITLE_DISABLE_ANSI_TITLE) instanceof Boolean disableAnsi) {
// Check if terminal title can be updated from ANSI escape sequence
if (disableAnsi && requestor == TerminalTitleRequestor.ANSI) {
return;
}
}
}
// New title must have value.
if (title != null) {