X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=core%2Fsrc%2Fnet%2Fsf%2Fopenrocket%2Fsimulation%2FFlightDataBranch.java;h=76bef7642841cc5150969b912d1efd19032b8796;hb=dc2aa2b0bd1e22f097fc38038baedf345e834e2e;hp=475a068eecf96faf20dda54dfffb7ef6da733596;hpb=65eedea8e0080d564e5bfd84b35ae70bdfd4f65b;p=debian%2Fopenrocket diff --git a/core/src/net/sf/openrocket/simulation/FlightDataBranch.java b/core/src/net/sf/openrocket/simulation/FlightDataBranch.java index 475a068e..76bef764 100644 --- a/core/src/net/sf/openrocket/simulation/FlightDataBranch.java +++ b/core/src/net/sf/openrocket/simulation/FlightDataBranch.java @@ -106,8 +106,8 @@ public class FlightDataBranch implements Monitorable { mutable.check(); ArrayList list = values.get(type); + if (list == null) { - list = new ArrayList(); int n = getLength(); for (int i = 0; i < n; i++) { @@ -115,10 +115,13 @@ public class FlightDataBranch implements Monitorable { } values.put(type, list); minValues.put(type, value); - maxValues.put(type, value); - + maxValues.put(type, value); } - list.set(list.size() - 1, value); + + if (list.size() > 0){ + list.set(list.size() - 1, value); + } + double min = minValues.get(type); double max = maxValues.get(type);