diff --git a/gi/arg.cpp b/gi/arg.cpp
index 1b45093e..4a92ef66 100644
--- a/gi/arg.cpp
+++ b/gi/arg.cpp
@@ -598,7 +598,7 @@ gjs_array_from_strv(JSContext             *context,
     }
 
     JS::RootedObject obj(context, JS_NewArrayObject(context, elems));
-    if (obj == NULL)
+    if (obj == nullptr)
         return false;
 
     value_p.setObject(*obj);
@@ -2202,7 +2202,7 @@ gjs_array_from_g_list (JSContext             *context,
     }
 
     JS::RootedObject obj(context, JS_NewArrayObject(context, elems));
-    if (obj == NULL)
+    if (obj == nullptr)
         return false;
 
     value_p.setObject(*obj);
@@ -2235,7 +2235,7 @@ gjs_array_from_carray_internal (JSContext             *context,
 
         JS::RootedObject obj(context,
             gjs_byte_array_from_byte_array(context, &gbytearray));
-        if (obj == NULL)
+        if (obj == nullptr)
             return false;
         value_p.setObject(*obj);
         return true;
@@ -2343,7 +2343,7 @@ gjs_array_from_carray_internal (JSContext             *context,
 #undef ITERATE
 
     JS::RootedObject obj(context, JS_NewArrayObject(context, elems));
-    if (obj == NULL)
+    if (obj == nullptr)
         return false;
 
     value_p.setObject(*obj);
@@ -2452,7 +2452,7 @@ gjs_array_from_zero_terminated_c_array (JSContext             *context,
 
         JS::RootedObject obj(context,
             gjs_byte_array_from_byte_array(context, &gbytearray));
-        if (obj == NULL)
+        if (obj == nullptr)
             return false;
         value_p.setObject(*obj);
         return true;
@@ -2536,7 +2536,7 @@ gjs_array_from_zero_terminated_c_array (JSContext             *context,
 #undef ITERATE
 
     JS::RootedObject obj(context, JS_NewArrayObject(context, elems));
-    if (obj == NULL)
+    if (obj == nullptr)
         return false;
 
     value_p.setObject(*obj);
@@ -2562,7 +2562,7 @@ gjs_object_from_g_hash (JSContext             *context,
     }
 
     JS::RootedObject obj(context, JS_NewPlainObject(context));
-    if (obj == NULL)
+    if (obj == nullptr)
         return false;
 
     value_p.setObject(*obj);
diff --git a/gi/boxed.cpp b/gi/boxed.cpp
index e7cd79dd..704438b9 100644
--- a/gi/boxed.cpp
+++ b/gi/boxed.cpp
@@ -561,7 +561,7 @@ get_nested_interface_object(JSContext             *context,
 
     obj = JS_NewObjectWithGivenProto(context, JS_GetClass(proto), proto);
 
-    if (obj == NULL)
+    if (obj == nullptr)
         return false;
 
     GJS_INC_COUNTER(boxed);
@@ -1257,7 +1257,7 @@ gjs_c_struct_from_boxed(JSContext       *context,
 {
     Boxed *priv;
 
-    if (obj == NULL)
+    if (obj == nullptr)
         return NULL;
 
     priv = priv_from_js(context, obj);
diff --git a/gi/closure.cpp b/gi/closure.cpp
index 4173f985..d51dd481 100644
--- a/gi/closure.cpp
+++ b/gi/closure.cpp
@@ -111,7 +111,7 @@ global_context_finalized(JS::HandleObject obj,
                       c, c->obj.get());
 
     if (c->obj != NULL) {
-        g_assert(c->obj == obj);
+        g_assert(c->obj == obj.get());
 
         invalidate_js_pointers(gc);
     }
diff --git a/gi/enumeration.cpp b/gi/enumeration.cpp
index 9b0f4701..4c2da397 100644
--- a/gi/enumeration.cpp
+++ b/gi/enumeration.cpp
@@ -165,7 +165,7 @@ gjs_define_enumeration(JSContext       *context,
     enum_name = g_base_info_get_name( (GIBaseInfo*) info);
 
     JS::RootedObject enum_obj(context, JS_NewPlainObject(context));
-    if (enum_obj == NULL) {
+    if (enum_obj == nullptr) {
         g_error("Could not create enumeration %s.%s",
                	g_base_info_get_namespace( (GIBaseInfo*) info),
                 enum_name);
diff --git a/gi/function.cpp b/gi/function.cpp
index c844fdd2..8ce06f77 100644
--- a/gi/function.cpp
+++ b/gi/function.cpp
@@ -119,7 +119,7 @@ set_return_ffi_arg_from_giargument (GITypeInfo  *ret_type,
     case GI_TYPE_TAG_BOOLEAN:
     case GI_TYPE_TAG_UNICHAR:
         *(ffi_arg *) result = return_value->v_uint32;
-		
+
         break;
     case GI_TYPE_TAG_INT64:
         *(ffi_sarg *) result = return_value->v_int64;
@@ -955,7 +955,7 @@ gjs_invoke_c_function(JSContext                             *context,
                 }
                 /* Also handle the INOUT for the length here */
                 if (direction == GI_DIRECTION_INOUT) {
-                    if (in_value->v_pointer == NULL) { 
+                    if (in_value->v_pointer == NULL) {
                         /* Special case where we were given JS null to
                          * also pass null for length, and not a
                          * pointer to an integer that derefs to 0.
@@ -1697,7 +1697,7 @@ function_new(JSContext      *context,
 
     JS::RootedObject function(context,
         JS_NewObjectWithGivenProto(context, &gjs_function_class, proto));
-    if (function == NULL) {
+    if (function == nullptr) {
         gjs_debug(GJS_DEBUG_GFUNCTION, "Failed to construct function");
         return NULL;
     }
@@ -1734,7 +1734,7 @@ gjs_define_function(JSContext       *context,
     JSAutoRequest ar(context);
 
     JS::RootedObject function(context, function_new(context, gtype, info));
-    if (function == NULL)
+    if (function == nullptr)
         return NULL;
 
     if (info_type == GI_INFO_TYPE_FUNCTION) {
diff --git a/gi/fundamental.cpp b/gi/fundamental.cpp
index ca2a422a..741aad89 100644
--- a/gi/fundamental.cpp
+++ b/gi/fundamental.cpp
@@ -612,7 +612,7 @@ gjs_lookup_fundamental_prototype(JSContext    *context,
         constructor = &value.toObject();
     }
 
-    g_assert(constructor != NULL);
+    g_assert(constructor != nullptr);
 
     if (!gjs_object_get_property(context, constructor,
                                  GJS_STRING_PROTOTYPE, &value))
@@ -772,7 +772,7 @@ gjs_object_from_g_fundamental(JSContext    *context,
 
     object = JS_NewObjectWithGivenProto(context, JS_GetClass(proto), proto);
 
-    if (object == NULL)
+    if (object == nullptr)
         goto out;
 
     init_fundamental_instance(context, object);
@@ -814,7 +814,7 @@ gjs_g_fundamental_from_object(JSContext       *context,
 {
     FundamentalInstance *priv;
 
-    if (obj == NULL)
+    if (obj == nullptr)
         return NULL;
 
     priv = priv_from_js(context, obj);
diff --git a/gi/gerror.cpp b/gi/gerror.cpp
index 7a63e17e..d35f186a 100644
--- a/gi/gerror.cpp
+++ b/gi/gerror.cpp
@@ -470,7 +470,7 @@ gjs_gerror_from_error(JSContext       *context,
 {
     Error *priv;
 
-    if (obj == NULL)
+    if (obj == nullptr)
         return NULL;
 
     /* If this is a plain GBoxed (i.e. a GError without metadata),
diff --git a/gi/ns.cpp b/gi/ns.cpp
index 376cc207..af3c2f5e 100644
--- a/gi/ns.cpp
+++ b/gi/ns.cpp
@@ -190,7 +190,7 @@ ns_new(JSContext    *context,
 
     JS::RootedObject ns(context,
         JS_NewObjectWithGivenProto(context, &gjs_ns_class, proto));
-    if (ns == NULL)
+    if (ns == nullptr)
         g_error("No memory to create ns object");
 
     priv = g_slice_new0(Ns);
diff --git a/gi/object.cpp b/gi/object.cpp
index 2bf51db7..b1bb8543 100644
--- a/gi/object.cpp
+++ b/gi/object.cpp
@@ -1283,7 +1283,7 @@ G_GNUC_END_IGNORE_DEPRECATIONS
     free_g_params(&params[0], params.size());
 
     ObjectInstance *other_priv = get_object_qdata(gobj);
-    if (other_priv && other_priv->keep_alive != object) {
+    if (other_priv && other_priv->keep_alive != object.get()) {
         /* g_object_newv returned an object that's already tracked by a JS
          * object. Let's assume this is a singleton like IBus.IBus and return
          * the existing JS wrapper object.
@@ -1543,7 +1543,7 @@ gjs_lookup_object_constructor_from_info(JSContext    *context,
         constructor = &value.toObject();
     }
 
-    g_assert(constructor != NULL);
+    g_assert(constructor != nullptr);
 
     return constructor;
 }
@@ -1556,7 +1556,7 @@ gjs_lookup_object_prototype_from_info(JSContext    *context,
     JS::RootedObject constructor(context,
         gjs_lookup_object_constructor_from_info(context, info, gtype));
 
-    if (G_UNLIKELY (constructor == NULL))
+    if (G_UNLIKELY (constructor == nullptr))
         return NULL;
 
     JS::RootedValue value(context);
@@ -1917,7 +1917,7 @@ gjs_define_object_class(JSContext              *context,
     const char *ns;
     GType parent_type;
 
-    g_assert(in_object != NULL);
+    g_assert(in_object != nullptr);
     g_assert(gtype != G_TYPE_INVALID);
 
     /*   http://egachine.berlios.de/embedding-sm-best-practice/apa.html
@@ -2034,7 +2034,7 @@ gjs_object_from_g_object(JSContext    *context,
 
         JS::RootedObject obj(context,
             JS_NewObjectWithGivenProto(context, JS_GetClass(proto), proto));
-        if (obj == NULL)
+        if (obj == nullptr)
             return nullptr;
 
         priv = init_object_private(context, obj);
@@ -2045,7 +2045,7 @@ gjs_object_from_g_object(JSContext    *context,
         /* see the comment in init_object_instance() for this */
         g_object_unref(gobj);
 
-        g_assert(priv->keep_alive == obj);
+        g_assert(priv->keep_alive == obj.get());
     }
 
     return priv->keep_alive;
@@ -2057,7 +2057,7 @@ gjs_g_object_from_object(JSContext       *context,
 {
     ObjectInstance *priv;
 
-    if (obj == NULL)
+    if (obj == nullptr)
         return NULL;
 
     priv = priv_from_js(context, obj);
@@ -2774,7 +2774,7 @@ gjs_register_interface(JSContext *cx,
 
     /* create a custom JSClass */
     JS::RootedObject module(cx, gjs_lookup_private_namespace(cx));
-    if (module == NULL)
+    if (module == nullptr)
         return false;  /* error will have been thrown already */
 
     JS::RootedObject constructor(cx);
diff --git a/gi/param.cpp b/gi/param.cpp
index 2806d2a7..f7b21698 100644
--- a/gi/param.cpp
+++ b/gi/param.cpp
@@ -189,7 +189,7 @@ gjs_lookup_param_prototype(JSContext    *context)
         return NULL;
 
     JS::RootedObject constructor(context, &value.toObject());
-    g_assert(constructor != NULL);
+    g_assert(constructor != nullptr);
 
     if (!gjs_object_get_property(context, constructor,
                                  GJS_STRING_PROTOTYPE, &value))
@@ -280,7 +280,7 @@ gjs_g_param_from_param(JSContext       *context,
 {
     Param *priv;
 
-    if (obj == NULL)
+    if (obj == nullptr)
         return NULL;
 
     priv = priv_from_js(context, obj);
diff --git a/gi/repo.cpp b/gi/repo.cpp
index a06aeaaf..0f28cf8f 100644
--- a/gi/repo.cpp
+++ b/gi/repo.cpp
@@ -769,7 +769,7 @@ gjs_lookup_generic_prototype(JSContext  *context,
 {
     JS::RootedObject constructor(context,
                                  gjs_lookup_generic_constructor(context, info));
-    if (G_UNLIKELY (constructor == NULL))
+    if (G_UNLIKELY (constructor == nullptr))
         return NULL;
 
     JS::RootedValue value(context);
diff --git a/gi/union.cpp b/gi/union.cpp
index dad723c7..85d9993a 100644
--- a/gi/union.cpp
+++ b/gi/union.cpp
@@ -422,7 +422,7 @@ gjs_c_union_from_union(JSContext       *context,
 {
     Union *priv;
 
-    if (obj == NULL)
+    if (obj == nullptr)
         return NULL;
 
     priv = priv_from_js(context, obj);
diff --git a/gjs/byteArray.cpp b/gjs/byteArray.cpp
index 88b38e27..21d3d3d2 100644
--- a/gjs/byteArray.cpp
+++ b/gjs/byteArray.cpp
@@ -201,7 +201,7 @@ byte_array_get_prop(JSContext *context,
 
     priv = priv_from_js(context, obj);
 
-    if (priv == NULL)
+    if (priv == nullptr)
         return true; /* prototype, not an instance. */
 
     JS::RootedValue id_value(context);
@@ -231,7 +231,7 @@ byte_array_length_getter(JSContext *context,
     GJS_GET_PRIV(context, argc, vp, args, to, ByteArrayInstance, priv);
     gsize len = 0;
 
-    if (priv == NULL)
+    if (priv == nullptr)
         return true; /* prototype, not an instance. */
 
     if (priv->array != NULL)
@@ -250,7 +250,7 @@ byte_array_length_setter(JSContext *context,
     GJS_GET_PRIV(context, argc, vp, args, to, ByteArrayInstance, priv);
     gsize len = 0;
 
-    if (priv == NULL)
+    if (priv == nullptr)
         return true; /* prototype, not instance */
 
     byte_array_ensure_array(priv);
@@ -309,7 +309,7 @@ byte_array_set_prop(JSContext *context,
 
     priv = priv_from_js(context, obj);
 
-    if (priv == NULL)
+    if (priv == nullptr)
         return result.succeed(); /* prototype, not an instance. */
 
     JS::RootedValue id_value(context);
@@ -388,7 +388,7 @@ byte_array_finalize(JSFreeOp *fop,
 
     priv = (ByteArrayInstance*) JS_GetPrivate(obj);
 
-    if (priv == NULL)
+    if (priv == nullptr)
         return; /* prototype, not instance */
 
     if (priv->array) {
@@ -412,7 +412,7 @@ to_string_func(JSContext *context,
     bool encoding_is_utf8;
     gchar *data;
 
-    if (priv == NULL)
+    if (priv == nullptr)
         return true; /* prototype, not instance */
 
     byte_array_ensure_array(priv);
@@ -492,7 +492,7 @@ to_gbytes_func(JSContext *context,
     JSObject *ret_bytes_obj;
     GIBaseInfo *gbytes_info;
 
-    if (priv == NULL)
+    if (priv == nullptr)
         return true; /* prototype, not instance */
 
     byte_array_ensure_gbytes(priv);
@@ -534,7 +534,7 @@ from_string_func(JSContext *context,
     bool encoding_is_utf8;
     JS::RootedObject obj(context, byte_array_new(context));
 
-    if (obj == NULL)
+    if (obj == nullptr)
         return false;
 
     priv = priv_from_js(context, obj);
@@ -643,7 +643,7 @@ from_array_func(JSContext *context,
     bool is_array;
     JS::RootedObject obj(context, byte_array_new(context));
 
-    if (obj == NULL)
+    if (obj == nullptr)
         return false;
 
     priv = priv_from_js(context, obj);
@@ -715,7 +715,7 @@ from_gbytes_func(JSContext *context,
     gbytes = (GBytes*) gjs_c_struct_from_boxed(context, bytes_obj);
 
     JS::RootedObject obj(context, byte_array_new(context));
-    if (obj == NULL)
+    if (obj == nullptr)
         return false;
     priv = priv_from_js(context, obj);
     g_assert (priv != NULL);
diff --git a/gjs/coverage.cpp b/gjs/coverage.cpp
index 2c743595..38a22995 100644
--- a/gjs/coverage.cpp
+++ b/gjs/coverage.cpp
@@ -1341,11 +1341,11 @@ coverage_log(JSContext *context,
      * could not be converted to string */
     exc_state = JS_SaveExceptionState(context);
     JS::RootedString jstr(context, JS::ToString(context, argv[0]));
-    if (jstr != NULL)
+    if (jstr != nullptr)
         argv[0].setString(jstr);  // GC root
     JS_RestoreExceptionState(context, exc_state);
 
-    if (jstr == NULL) {
+    if (jstr == nullptr) {
         g_message("JS LOG: <cannot convert value to string>");
         return true;
     }
@@ -1392,7 +1392,7 @@ coverage_get_file_modification_time(JSContext *context,
         mtime_values_array[1].setInt32(mtime.tv_usec);
         JS::RootedObject array_obj(context,
             JS_NewArrayObject(context, mtime_values_array));
-        if (array_obj == NULL)
+        if (array_obj == nullptr)
             goto out;
         args.rval().setObject(*array_obj);
     } else {
diff --git a/gjs/global.cpp b/gjs/global.cpp
index 16dd5bd1..8a6bd949 100644
--- a/gjs/global.cpp
+++ b/gjs/global.cpp
@@ -51,7 +51,7 @@ gjs_log(JSContext *cx,
     JS::RootedString jstr(cx, JS::ToString(cx, argv[0]));
     exc_state.restore();
 
-    if (jstr == NULL) {
+    if (jstr == nullptr) {
         g_message("JS LOG: <cannot convert value to string>");
         return true;
     }
@@ -114,7 +114,7 @@ gjs_print_parse_args(JSContext    *cx,
         JS::RootedString jstr(cx, JS::ToString(cx, argv[n]));
         exc_state.restore();
 
-        if (jstr != NULL) {
+        if (jstr != nullptr) {
             GjsAutoJSChar s(cx);
             if (!gjs_string_to_utf8(cx, JS::StringValue(jstr), &s)) {
                 g_string_free(str, true);
diff --git a/gjs/importer.cpp b/gjs/importer.cpp
index 1a2ff6ea..47b1dbe3 100644
--- a/gjs/importer.cpp
+++ b/gjs/importer.cpp
@@ -184,7 +184,7 @@ import_directory(JSContext       *context,
      * this always succeeds.
      */
     importer = gjs_define_importer(context, obj, name, full_paths, false);
-    return importer != NULL;
+    return importer != nullptr;
 }
 
 /* Make the property we set in gjs_module_import() permanent;
@@ -199,7 +199,7 @@ seal_import(JSContext       *cx,
     JS::Rooted<JS::PropertyDescriptor> descr(cx);
 
     if (!JS_GetOwnPropertyDescriptorById(cx, obj, id, &descr) ||
-        descr.object() == NULL) {
+        descr.object() == nullptr) {
         gjs_debug(GJS_DEBUG_IMPORTER,
                   "Failed to get attributes to seal '%s' in importer",
                   name);
@@ -386,7 +386,7 @@ load_module_elements(JSContext        *cx,
     size_t ix, length;
     JS::RootedObject module_obj(cx, load_module_init(cx, in_object, init_path));
 
-    if (module_obj == NULL)
+    if (module_obj == nullptr)
         return;
 
     JS::Rooted<JS::IdVector> ids(cx, cx);
@@ -801,7 +801,7 @@ importer_resolve(JSContext        *context,
     gjs_debug_jsprop(GJS_DEBUG_IMPORTER,
                      "Resolve prop '%s' hook obj %p priv %p",
                      name.get(), obj.get(), priv);
-    if (priv == NULL) {
+    if (priv == nullptr) {
         /* we are the prototype, or have the wrong class */
         *resolved = false;
         return true;
@@ -826,7 +826,7 @@ importer_finalize(js::FreeOp *fop,
     priv = (Importer*) JS_GetPrivate(obj);
     gjs_debug_lifecycle(GJS_DEBUG_IMPORTER,
                         "finalize, obj %p priv %p", obj, priv);
-    if (priv == NULL)
+    if (priv == nullptr)
         return; /* we are the prototype, not a real instance */
 
     GJS_DEC_COUNTER(importer);
@@ -893,7 +893,7 @@ importer_new(JSContext *context,
 
     JS::RootedObject importer(context,
         JS_NewObjectWithGivenProto(context, &gjs_importer_class, proto));
-    if (importer == NULL)
+    if (importer == nullptr)
         g_error("No memory to create importer");
 
     priv = g_slice_new0(Importer);
diff --git a/gjs/jsapi-class.h b/gjs/jsapi-class.h
index 508c828e..99243e5f 100644
--- a/gjs/jsapi-class.h
+++ b/gjs/jsapi-class.h
@@ -307,7 +307,7 @@ gjs_##name##_constructor(JSContext  *context,           \
         return false;                                                         \
     }                                                                         \
     object = JS_NewObjectForConstructor(context, &gjs_##name##_class, argv);  \
-    if (object == NULL)                                                       \
+    if (object == nullptr)                                                       \
         return false;                                                         \
 }
 
diff --git a/gjs/jsapi-util-error.cpp b/gjs/jsapi-util-error.cpp
index 1196bd0e..101ecc0f 100644
--- a/gjs/jsapi-util-error.cpp
+++ b/gjs/jsapi-util-error.cpp
@@ -97,7 +97,7 @@ gjs_throw_valist(JSContext       *context,
     constructor = &v_constructor.toObject();
     new_exc = JS_New(context, constructor, error_args);
 
-    if (new_exc == NULL)
+    if (new_exc == nullptr)
         goto out;
 
     if (error_name != NULL) {
diff --git a/gjs/jsapi-util-string.cpp b/gjs/jsapi-util-string.cpp
index 53f32f5e..4e17e2e5 100644
--- a/gjs/jsapi-util-string.cpp
+++ b/gjs/jsapi-util-string.cpp
@@ -87,7 +87,7 @@ gjs_string_from_utf8(JSContext             *context,
         value_p.setString(str);
 
     JS_EndRequest(context);
-    return str != NULL;
+    return str != nullptr;
 }
 
 bool
@@ -313,7 +313,7 @@ gjs_string_from_ucs4(JSContext             *cx,
     /* Avoid a copy - assumes that g_malloc == js_malloc == malloc */
     JS::RootedString str(cx, JS_NewUCString(cx, u16_string, u16_string_length));
 
-    if (str == NULL) {
+    if (str == nullptr) {
         gjs_throw(cx, "Failed to convert UCS-4 string to UTF-16");
         return false;
     }
diff --git a/gjs/jsapi-util.cpp b/gjs/jsapi-util.cpp
index 1fc48bd6..7d4fb890 100644
--- a/gjs/jsapi-util.cpp
+++ b/gjs/jsapi-util.cpp
@@ -315,11 +315,11 @@ gjs_define_string_array(JSContext       *context,
     JS::RootedObject array(context,
         gjs_build_string_array(context, array_length, (char **) array_values));
 
-    if (array == NULL)
-        return NULL;
+    if (array == nullptr)
+        return nullptr;
 
     if (!JS_DefineProperty(context, in_object, array_name, array, attrs))
-        return NULL;
+        return nullptr;
 
     return array;
 }
@@ -378,7 +378,7 @@ _gjs_g_utf8_make_valid (const char *name)
 
     g_return_val_if_fail (name != NULL, NULL);
 
-    string = NULL;
+    string = nullptr;
     remainder = name;
     remaining_bytes = strlen (name);
 
@@ -387,7 +387,7 @@ _gjs_g_utf8_make_valid (const char *name)
             break;
         valid_bytes = invalid - remainder;
 
-        if (string == NULL)
+        if (string == nullptr)
             string = g_string_sized_new (remaining_bytes);
 
         g_string_append_len (string, remainder, valid_bytes);
@@ -398,7 +398,7 @@ _gjs_g_utf8_make_valid (const char *name)
         remainder = invalid + 1;
     }
 
-    if (string == NULL)
+    if (string == nullptr)
         return g_strdup (name);
 
     g_string_append (string, remainder);
@@ -431,7 +431,7 @@ gjs_value_debug_string(JSContext      *context,
 
     JS::RootedString str(context, JS::ToString(context, value));
 
-    if (str == NULL) {
+    if (str == nullptr) {
         if (value.isObject()) {
             /* Specifically the Call object (see jsfun.c in spidermonkey)
              * does not have a toString; there may be others also.
@@ -440,7 +440,7 @@ gjs_value_debug_string(JSContext      *context,
             if (klass != NULL) {
                 str = JS_NewStringCopyZ(context, klass->name);
                 JS_ClearPendingException(context);
-                if (str == NULL) {
+                if (str == nullptr) {
                     JS_EndRequest(context);
                     return g_strdup("[out of memory copying class name]");
                 }
@@ -455,7 +455,7 @@ gjs_value_debug_string(JSContext      *context,
         }
     }
 
-    g_assert(str != NULL);
+    g_assert(str != nullptr);
 
     bytes = JS_EncodeStringToUTF8(context, str);
     JS_EndRequest(context);
@@ -472,7 +472,7 @@ utf8_exception_from_non_gerror_value(JSContext      *cx,
 {
     GjsAutoJSChar utf8_exception(cx);
     JS::RootedString exc_str(cx, JS::ToString(cx, exc));
-    if (exc_str != NULL)
+    if (exc_str != nullptr)
         gjs_string_to_utf8(cx, JS::StringValue(exc_str), &utf8_exception);
     return utf8_exception.copy();
 }
@@ -515,7 +515,7 @@ gjs_log_exception_full(JSContext       *context,
         }
     }
 
-    if (message != NULL)
+    if (message != nullptr)
         gjs_string_to_utf8(context, JS::StringValue(message), &utf8_message);
 
     /* We log syntax errors differently, because the stack for those includes
@@ -540,7 +540,7 @@ gjs_log_exception_full(JSContext       *context,
 
         lineNumber = js_lineNumber.toInt32();
 
-        if (message != NULL) {
+        if (message != nullptr) {
             g_critical("JS ERROR: %s: %s @ %s:%u", utf8_message.get(), utf8_exception,
                        utf8_filename.get(), lineNumber);
         } else {
diff --git a/modules/cairo-pattern.cpp b/modules/cairo-pattern.cpp
index f82fbb94..d22fb64e 100644
--- a/modules/cairo-pattern.cpp
+++ b/modules/cairo-pattern.cpp
@@ -114,7 +114,7 @@ gjs_cairo_pattern_construct(JSContext       *context,
     GjsCairoPattern *priv;
 
     g_return_if_fail(context != NULL);
-    g_return_if_fail(object != NULL);
+    g_return_if_fail(object != nullptr);
     g_return_if_fail(pattern != NULL);
 
     priv = g_slice_new0(GjsCairoPattern);
diff --git a/modules/cairo-surface.cpp b/modules/cairo-surface.cpp
index af783f9e..8f0e50a5 100644
--- a/modules/cairo-surface.cpp
+++ b/modules/cairo-surface.cpp
@@ -150,7 +150,7 @@ gjs_cairo_surface_construct(JSContext       *context,
     GjsCairoSurface *priv;
 
     g_return_if_fail(context != NULL);
-    g_return_if_fail(object != NULL);
+    g_return_if_fail(object != nullptr);
     g_return_if_fail(surface != NULL);
 
     priv = g_slice_new0(GjsCairoSurface);
