Skip to content

Commit

Permalink
Merge pull request #126 from odow/patch-3
Browse files Browse the repository at this point in the history
Fix unsafe_load of uninitialized workspace
  • Loading branch information
imciner2 authored Jun 13, 2024
2 parents 443706e + f414542 commit 8197027
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/interface.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 8197027

Please sign in to comment.