From 6bf92dcd4bf6cb5dcc653b561328473fb3a8ad32 Mon Sep 17 00:00:00 2001 From: Nicholas Bauer Date: Thu, 26 Aug 2021 08:22:17 -0400 Subject: [PATCH] Test for error value from `apply_recipe` fallback. (#95) --- RecipesPipeline/src/plot_recipe.jl | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/RecipesPipeline/src/plot_recipe.jl b/RecipesPipeline/src/plot_recipe.jl index 06e2db956..3630629f2 100644 --- a/RecipesPipeline/src/plot_recipe.jl +++ b/RecipesPipeline/src/plot_recipe.jl @@ -31,15 +31,20 @@ function _process_plotrecipe(plt, kw, kw_list, still_to_process) st = kw[:seriestype] st = kw[:seriestype] = type_alias(plt, st) datalist = RecipesBase.apply_recipe(kw, Val{st}, plt) - warn_on_recipe_aliases!(plt, datalist, :plot, st) - for data in datalist - preprocess_attributes!(plt, data.plotattributes) - if data.plotattributes[:seriestype] == st - error("Plot recipe $st returned the same seriestype: $(data.plotattributes)") + if !isnothing(datalist) + warn_on_recipe_aliases!(plt, datalist, :plot, st) + for data in datalist + preprocess_attributes!(plt, data.plotattributes) + if data.plotattributes[:seriestype] == st + error("Plot recipe $st returned the same seriestype: $(data.plotattributes)") + end + push!(still_to_process, data.plotattributes) end - push!(still_to_process, data.plotattributes) + else + push!(kw_list, kw) end catch err + # the try/catch block can be removed when Plots.jl makes the compensating change if err isa MethodError && occursin("plot recipe", err.args) push!(kw_list, kw) else