diff --git a/src/ParallelPlots.jl b/src/ParallelPlots.jl index a345861..d4927dd 100644 --- a/src/ParallelPlots.jl +++ b/src/ParallelPlots.jl @@ -18,9 +18,6 @@ checks the Input Data if the size is correct and no missing values are available Throws error on wrong DF """ function input_data_check(data::DataFrame)::Nothing - if isnothing(data) - throw(ArgumentError("Data cannot be nothing")) - end if size(data, 2) < 2 # otherwise there will be a nullpointer exception later throw(ArgumentError("Data must have at least two columns, currently ("*string(size(data, 2))*")")) end @@ -120,6 +117,10 @@ function Makie.plot!(pp::ParallelPlot) # whenever df_observable change function update_plot(data) + if isnothing(data) + throw(ArgumentError("Data cannot be nothing")) + end + # check the given DataFrame input_data_check(data) diff --git a/test/test_argument_errors.jl b/test/test_argument_errors.jl index cd7151e..0cd27f8 100644 --- a/test/test_argument_errors.jl +++ b/test/test_argument_errors.jl @@ -25,4 +25,7 @@ using CairoMakie: save @test_throws ArgumentError begin parallelplot(df_one_line) end + @test_throws ArgumentError begin + parallelplot(nothing) + end end \ No newline at end of file