Skip to content

Commit

Permalink
Fixes #54
Browse files Browse the repository at this point in the history
  • Loading branch information
bstellato committed Mar 27, 2018
1 parent 81412c0 commit 370dd33
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
Changes since last release
--------------------------
* Fixed [#54](https://github.com/oxfordcontrol/osqp/issues/54).


Version 0.3.0 (5 March 2018)
----------------------------
Expand Down
15 changes: 8 additions & 7 deletions src/osqp.c
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,14 @@ c_int osqp_solve(OSQPWorkspace *work) {
c_int can_print; // Boolean whether you can print
#endif /* ifdef PRINTING */

// Check if workspace has been initialized
if (!work) {
#ifdef PRINTING
c_eprint("Workspace not initialized");
#endif /* ifdef PRINTING */
return -1;
}

// Initialize variables
exitflag = 0;
can_check_termination = 0;
Expand All @@ -298,13 +306,6 @@ c_int osqp_solve(OSQPWorkspace *work) {
#endif /* ifdef PRINTING */


// Check if workspace has been initialized
if (!work) {
#ifdef PRINTING
c_eprint("Workspace not initialized");
#endif /* ifdef PRINTING */
return -1;
}

#ifdef PROFILING
tic(work->timer); // Start timer
Expand Down

0 comments on commit 370dd33

Please sign in to comment.