Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions src/ParallelPlots.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)

Expand Down
3 changes: 3 additions & 0 deletions test/test_argument_errors.jl
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,7 @@ using CairoMakie: save
@test_throws ArgumentError begin
parallelplot(df_one_line)
end
@test_throws ArgumentError begin
parallelplot(nothing)
end
end
Loading