Skip to content

Commit

Permalink
Add a missing null check since terminal properties can be null
Browse files Browse the repository at this point in the history
Removes a redundant map lookup too.

Fixes eclipse-cdt#617
  • Loading branch information
jonahgraham committed Nov 14, 2023
1 parent f5754e2 commit b3cf860
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 b3cf860

Please sign in to comment.