Skip to content

Commit 981c303

Browse files
committed
added in a check to ensure that nonexistent data is not accessed for initial state prediction
1 parent 20a5dbb commit 981c303

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/PrettyPlots/NLOptControl_plots.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ function statePlot(n,idx::Int64,st::Int64,args...;kwargs...)
132132

133133
plot!(time,vals,line=_pretty_defaults[:plant_lines][1],label=string(legend_string,"plant"));
134134
end
135-
if _pretty_defaults[:X0p]
135+
if _pretty_defaults[:X0p] && length(n.r.ip.X0p) > idx
136136
X0 = n.r.ip.X0p[idx][1]
137137
t = n.r.ip.X0p[idx][2]
138138
scatter!((t,X0[st]),marker=_pretty_defaults[:X0p_marker],label="X0p")

0 commit comments

Comments
 (0)