From ad46bb9b6e4a362d6017d0136856d7709acf780f Mon Sep 17 00:00:00 2001 From: Ray Clark Date: Mon, 3 Oct 2022 11:20:47 +1100 Subject: [PATCH] Fixed NPE when scaling if no components are selected --- .../src/net/sf/openrocket/gui/main/DocumentSelectionModel.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/swing/src/net/sf/openrocket/gui/main/DocumentSelectionModel.java b/swing/src/net/sf/openrocket/gui/main/DocumentSelectionModel.java index 5d9277df7..dff4a0097 100644 --- a/swing/src/net/sf/openrocket/gui/main/DocumentSelectionModel.java +++ b/swing/src/net/sf/openrocket/gui/main/DocumentSelectionModel.java @@ -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 null. */ public List getSelectedComponents() { - if (componentSelection.size() == 0) return null; + if (componentSelection.size() == 0) return Collections.EMPTY_LIST; return componentSelection; }