Merge pull request #1716 from raynichc/fixes/ScalingNPE

Fixed NPE when scaling when no components are selected
This commit is contained in:
Joe Pfeiffer 2022-10-05 19:47:59 -06:00 committed by GitHub
commit d2e3ebfa07
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2,6 +2,7 @@ package net.sf.openrocket.gui.main;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.LinkedList;
import java.util.List;
@ -90,7 +91,7 @@ public class DocumentSelectionModel {
* @return the currently selected rocket components, or <code>null</code>.
*/
public List<RocketComponent> getSelectedComponents() {
if (componentSelection.size() == 0) return null;
if (componentSelection.size() == 0) return Collections.emptyList();
return componentSelection;
}