summaryrefslogtreecommitdiff
path: root/src/util.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/util.rs')
-rw-r--r--src/util.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/util.rs b/src/util.rs
index 1955431..31637dc 100644
--- a/src/util.rs
+++ b/src/util.rs
@@ -20,7 +20,7 @@ pub trait SessionBinding<'sess>: Sized {
unsafe fn from_raw_opt(sess: &'sess Session, raw: *mut Self::Raw)
-> Result<Self, Error> {
if raw.is_null() {
- Err(Error::last_error(sess).unwrap())
+ Err(Error::last_error(sess).unwrap_or_else(Error::unknown))
} else {
Ok(SessionBinding::from_raw(sess, raw))
}