Skip to content

Commit df03581

Browse files
committed
Prevent NPE in LaunchConfigurationTabGroupViewer.handleApplyPressed
Add a null check for fOriginal in LaunchConfigurationTabGroupViewer.handleApplyPressed to prevent a NullPointerException when switching between launch configurations. Fixes : #2571
1 parent 519a3b0 commit df03581

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationTabGroupViewer.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*******************************************************************************
2-
* Copyright (c) 2000, 2022 IBM Corporation and others.
2+
* Copyright (c) 2000, 2026 IBM Corporation and others.
33
*
44
* This program and the accompanying materials
55
* are made available under the terms of the Eclipse Public License 2.0
@@ -1513,7 +1513,10 @@ public ILaunchConfiguration handleApplyPressed() {
15131513
// trim name
15141514
String trimmed = fNameWidget.getText().trim();
15151515
fNameWidget.setText(trimmed);
1516-
if(fWorkingCopy == null) {
1516+
if (fWorkingCopy == null) {
1517+
if (fOriginal == null) {
1518+
return null;
1519+
}
15171520
fWorkingCopy = fOriginal.getWorkingCopy();
15181521
}
15191522
fWorkingCopy.rename(trimmed);

0 commit comments

Comments
 (0)