From f414542342eba77f35d60a393de1178dfe3568dd Mon Sep 17 00:00:00 2001 From: Oscar Dowson Date: Thu, 13 Jun 2024 19:40:10 +1200 Subject: [PATCH] Fix unsafe_load of uninitialized workspace --- src/interface.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/interface.jl b/src/interface.jl index 37b1faa..56057a1 100644 --- a/src/interface.jl +++ b/src/interface.jl @@ -738,10 +738,10 @@ end Obtain problem dimensions from OSQP model """ function dimensions(model::OSQP.Model) - workspace = unsafe_load(model.workspace) - if workspace == C_NULL + if model.workspace == C_NULL error("Workspace has not been setup yet") end + workspace = unsafe_load(model.workspace) data = unsafe_load(workspace.data) return data.n, data.m end