Skip to content

Commit

Permalink
Fixed crash-inducing bug in VariablesWindow
Browse files Browse the repository at this point in the history
  • Loading branch information
cstawarz committed Sep 6, 2017
1 parent dd42bb9 commit 8a797a9
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions plugins/client/VariablesWindow/MWVariablesWindowController.m
Expand Up @@ -205,6 +205,12 @@ - (void)controlTextDidEndEditing:(NSNotification *)notification {
} else {

NSInteger row = [self.outlineView rowForView:textField];
if (-1 == row) {
// The text field is not in the outline view, possibly because the outline view is currently
// executing reloadData (and ending editing as a consequence). Discard the edits.
return;
}

MWVariableDisplayItem *item = [self.outlineView itemAtRow:row];
if (!(item.isGroup)) {
[self setValue:textField.stringValue forVariable:item.name];
Expand Down

0 comments on commit 8a797a9

Please sign in to comment.