Default return empty list of fragment scans (fix for gap-filled)
/*
- * Copyright 2006-2020 The MZmine Development Team
+ * Copyright 2006-2021 The MZmine Development Team
*
* This file is part of MZmine.
*
* License, or (at your option) any later version.
*
* MZmine is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
- * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
- * Public License for more details.
+ * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with MZmine; if not,
- * write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ * write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
*/
package io.github.mzmine.datamodel.features;
@@ -60,6 +61,7 @@ import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
+import java.util.Objects;
import java.util.stream.Collectors;
import javafx.collections.FXCollections;
import javafx.collections.MapChangeListener;
@@ -371,7 +373,8 @@ public class ModularFeature implements Feature, ModularDataModel {
@Override
public List<Scan> getAllMS2FragmentScans() {
- return get(FragmentScanNumbersType.class);
+ // return empty list instead
+ return Objects.requireNonNullElse(get(FragmentScanNumbersType.class), List.of());
}
@Override
