From ffa3b8025b9defcf7974fac27de0c18f4ffa2684 Mon Sep 17 00:00:00 2001 From: sougandhs Date: Sat, 14 Mar 2026 07:05:18 +0530 Subject: [PATCH] Prevent NPE in LaunchConfigurationTabGroupViewer.handleApplyPressed Add a null check for fOriginal in LaunchConfigurationTabGroupViewer.handleApplyPressed to prevent a NullPointerException when switching between launch configurations. Fixes : https://github.com/eclipse-platform/eclipse.platform/issues/2571 --- .../LaunchConfigurationTabGroupViewer.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationTabGroupViewer.java b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationTabGroupViewer.java index b7fd73473d3..6afee89d19c 100644 --- a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationTabGroupViewer.java +++ b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationTabGroupViewer.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2022 IBM Corporation and others. + * Copyright (c) 2000, 2026 IBM Corporation and others. * * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 @@ -1513,7 +1513,10 @@ public ILaunchConfiguration handleApplyPressed() { // trim name String trimmed = fNameWidget.getText().trim(); fNameWidget.setText(trimmed); - if(fWorkingCopy == null) { + if (fWorkingCopy == null) { + if (fOriginal == null) { + return null; + } fWorkingCopy = fOriginal.getWorkingCopy(); } fWorkingCopy.rename(trimmed);