[gjs/ewlsh/callback-out-args] Apply 2 suggestion(s) to 1 file(s)
- From: Evan Welsh <ewlsh src gnome org>
- To: commits-list gnome org
- Cc: 
- Subject: [gjs/ewlsh/callback-out-args] Apply 2 suggestion(s) to 1 file(s)
- Date: Mon, 20 Sep 2021 02:42:21 +0000 (UTC)
commit d133a5c0cf5a8df9fcdaf2fa07ad2e2b0b91c846
Author: Philip Chimento <philip chimento gmail com>
Date:   Mon Sep 20 02:42:19 2021 +0000
    Apply 2 suggestion(s) to 1 file(s)
 gi/arg.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/gi/arg.cpp b/gi/arg.cpp
index 16e564d4..49f36d76 100644
--- a/gi/arg.cpp
+++ b/gi/arg.cpp
@@ -1875,11 +1875,11 @@ bool gjs_value_to_callback_out_arg(JSContext* context, JS::HandleValue value,
 
     // If the argument is optional and we're passed nullptr,
     // ignore the GJS value.
-    if (g_arg_info_is_optional(arg_info) && arg == nullptr)
+    if (g_arg_info_is_optional(arg_info) && !arg)
         return true;
 
     // Otherwise, throw an error to prevent a segfault.
-    if (arg == nullptr) {
+    if (!arg) {
         gjs_throw(context,
                   "Return value %s is not optional but was passed NULL",
                   g_base_info_get_name(arg_info));
[
Date Prev][
Date Next]   [
Thread Prev][
Thread Next]   
[
Thread Index]
[
Date Index]
[
Author Index]