[librsvg/wip/aruiz/rust-pixbuf-loader: 67/69] pixbuf-loader: check if **GError is null
- From: Marge Bot <marge-bot src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [librsvg/wip/aruiz/rust-pixbuf-loader: 67/69] pixbuf-loader: check if **GError is null
- Date: Tue, 20 Sep 2022 22:44:03 +0000 (UTC)
commit 8272f2e224ba2ad64a307d819cf06aa70662ddbd
Author: Alberto Ruiz <aruiz redhat com>
Date: Mon Aug 8 13:31:58 2022 +0100
pixbuf-loader: check if **GError is null
Part-of: <https://gitlab.gnome.org/GNOME/librsvg/-/merge_requests/722>
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]