Skip to content

Commit 1ad47c0

Browse files
committed
Fix copilot hint
1 parent 3c941d2 commit 1ad47c0

2 files changed

Lines changed: 12 additions & 1 deletion

File tree

ext/VortexStepMethodControlPlotsExt.jl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,8 +174,10 @@ function create_geometry_plot(body_aero::BodyAerodynamics, title, view_elevation
174174
set_plot_style(28; use_tex)
175175

176176
panels = body_aero.panels
177+
isempty(panels) && throw(ArgumentError("Cannot plot geometry: body_aero.panels is empty."))
178+
177179
va = if body_aero.has_distributed_va
178-
panels[1].va
180+
body_aero._va
179181
else
180182
isa(body_aero.va, Tuple) ? body_aero.va[1] : body_aero.va
181183
end

test/plotting/test_plotting.jl

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,15 @@ end
215215
end
216216

217217
if backend == "ControlPlots"
218+
body_aero_empty = create_body_aero()
219+
empty!(body_aero_empty.panels)
220+
@test_throws ArgumentError plot_geometry(
221+
body_aero_empty,
222+
"Rectangular_wing_geometry_empty_panels";
223+
is_save=false,
224+
is_show=false,
225+
)
226+
218227
body_aero_distributed = create_body_aero()
219228
n_panels = length(body_aero_distributed.panels)
220229
va_distribution = repeat([12.0 0.0 1.0], n_panels, 1)

0 commit comments

Comments
 (0)