Skip to content

Commit

Permalink
Make sure getLastError won't return an empty string as a false positive
Browse files Browse the repository at this point in the history
  • Loading branch information
justinfx committed May 19, 2020
1 parent 968bf5f commit 8637b7f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion ocio.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,11 @@ Errors
*/

func getLastError(ptr *C._HandleContext) error {
return errors.New(C.GoString(ptr.last_error))
e := C.GoString(ptr.last_error)
if e == "" {
return nil
}
return errors.New(e)
}

// An exception class for errors detected at runtime,
Expand Down

0 comments on commit 8637b7f

Please sign in to comment.