summaryrefslogtreecommitdiff
path: root/gi/repo.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'gi/repo.cpp')
-rw-r--r--gi/repo.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/gi/repo.cpp b/gi/repo.cpp
index 27e78b5e..92d67d65 100644
--- a/gi/repo.cpp
+++ b/gi/repo.cpp
@@ -556,9 +556,12 @@ lookup_override_function(JSContext *cx,
goto fail;
}
+ // If the override module is present, it must have a callable _init(). An
+ // override module without _init() is probably unintentional. (function
+ // being undefined means there was no override module.)
if (!gjs_object_require_property(cx, module, "override module",
atoms.init(), function) ||
- !function.isObjectOrNull()) {
+ !function.isObject() || !JS::IsCallable(&function.toObject())) {
gjs_throw(cx, "Unexpected value for _init in overrides module");
goto fail;
}