File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed
debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -57,10 +57,13 @@ public Object execute(ExecutionEvent event) throws ExecutionException {
5757 if (structuredSelection instanceof TreeSelection treeSelection ) {
5858 for (TreePath path : treeSelection .getPaths ()) {
5959 List <IVariable > variables = new ArrayList <>();
60- if (path .getSegmentCount () > 1 ) {
61- for (int e = 0 ; e < path .getSegmentCount (); e ++) {
62- IVariable variable = (IVariable ) path .getSegment (e );
63- variables .add (variable );
60+ int segments = path .getSegmentCount ();
61+ if (segments > 1 ) {
62+ for (int e = 0 ; e < segments ; e ++) {
63+ Object sel = path .getSegment (e );
64+ if (sel instanceof IVariable variable ) {
65+ variables .add (variable );
66+ }
6467 }
6568 IWatchExpressionFactoryAdapter2 factory = getFactory2 (variables );
6669 if (factory != null ) {
You can’t perform that action at this time.
0 commit comments