diff options
author | Michael Rennie | 2011-08-08 19:44:08 +0000 |
---|---|---|
committer | Michael Rennie | 2011-08-08 19:44:08 +0000 |
commit | d7bdf8af85680f9c5224787385a175abea285abf (patch) | |
tree | d3de92d8be24f09b48413bf155e876909180c378 | |
parent | 9a717cbe5911a8661ef51c63b785ebfd8d3caa85 (diff) | |
download | eclipse.platform.debug-d7bdf8af85680f9c5224787385a175abea285abf.tar.gz eclipse.platform.debug-d7bdf8af85680f9c5224787385a175abea285abf.tar.xz eclipse.platform.debug-d7bdf8af85680f9c5224787385a175abea285abf.zip |
Bug 352784 - Null pointer exception when press F2 on an expression in expression view without columnsR3_7_1
-rw-r--r-- | org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/EditWatchExpressinInPlaceAction.java | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/EditWatchExpressinInPlaceAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/EditWatchExpressinInPlaceAction.java index 1b09da346..fffbdd2bc 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/EditWatchExpressinInPlaceAction.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/EditWatchExpressinInPlaceAction.java @@ -56,26 +56,25 @@ public class EditWatchExpressinInPlaceAction extends Action implements ISelectio return; } - // Always edit multi-line expressions in dialog. Otherwise try to find the expression // column and activate cell editor there. int expressionColumn = getExpressionColumnIndex(); - if (expressionColumn != -1 || isWatchExpressionWithNewLine()) { + IWatchExpression[] expressions = fEditActionDelegate.getSelectedExpressions(); + if (expressionColumn != -1 && !isWatchExpressionWithNewLine(expressions)) { fViewer.editElement(selelection.getFirstElement(), expressionColumn); - } else { + } else if (expressions.length == 1) { fEditActionDelegate.run(this); } } - private boolean isWatchExpressionWithNewLine() { - IWatchExpression[] expressions = fEditActionDelegate.getSelectedExpressions(); + private boolean isWatchExpressionWithNewLine(IWatchExpression[] expressions) { return expressions.length == 1 && - expressions[0].getExpressionText().indexOf('\n') == -1; + expressions[0].getExpressionText().indexOf('\n') != -1; } private int getExpressionColumnIndex() { Object[] columnProperties = fViewer.getColumnProperties(); - for (int i = 0; i < columnProperties.length; i++) { + for (int i = 0; columnProperties != null && i < columnProperties.length; i++) { if (VariableColumnPresentation.COLUMN_VARIABLE_NAME.equals(columnProperties[i])) { return i; } |