[librsvg/wip/aruiz/rust-pixbuf-loader] pixbuf-loader: check if **GError is null
- From: Alberto Ruiz <aruiz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [librsvg/wip/aruiz/rust-pixbuf-loader] pixbuf-loader: check if **GError is null
- Date: Mon, 8 Aug 2022 12:32:06 +0000 (UTC)
commit 4154d9d9f0a5ca0b19ba8a214936a63875d41e83
Author: Alberto Ruiz <aruiz redhat com>
Date: Mon Aug 8 13:31:58 2022 +0100
pixbuf-loader: check if **GError is null
gdk-pixbuf-loader/src/lib.rs | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/gdk-pixbuf-loader/src/lib.rs b/gdk-pixbuf-loader/src/lib.rs
index 839b79508..fdb765d6f 100644
--- a/gdk-pixbuf-loader/src/lib.rs
+++ b/gdk-pixbuf-loader/src/lib.rs
@@ -115,8 +115,10 @@ unsafe extern "C" fn stop_load(user_data: glib_sys::gpointer, error: *mut *mut G
let pixbuf = match _inner_stop_load(&ctx) {
Ok(r) => r,
Err(e) => {
- let gerr = glib::Error::new(gdk_pixbuf::PixbufError::Failed, &e);
- *error = gerr.to_glib_full() as *mut GError;
+ if error != null_mut() {
+ let gerr = glib::Error::new(gdk_pixbuf::PixbufError::Failed, &e);
+ *error = gerr.to_glib_full() as *mut GError;
+ }
return false.into_glib();
}
};
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]