Skip to content

Commit

Permalink
Add a missing null check since terminal properties can be null (eclip…
Browse files Browse the repository at this point in the history
…se-cdt#620)

Removes a redundant map lookup too.

Fixes eclipse-cdt#617
  • Loading branch information
jonahgraham authored Nov 14, 2023
1 parent 9ba7215 commit 050770d
Showing 1 changed file with 5 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -127,13 +127,11 @@ private void updateTitle(final String title, final TerminalTitleRequestor reques
// 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) {
// Check if terminal title can be updated from ANSI escape sequence
if (disableAnsi && requestor == TerminalTitleRequestor.ANSI) {
return;
}
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;
}
}

Expand Down

0 comments on commit 050770d

Please sign in to comment.