[gjs: 4/9] fundamental: Deal with missing introspection info
- From: Cosimo Cecchi <cosimoc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gjs: 4/9] fundamental: Deal with missing introspection info
- Date: Fri, 30 Aug 2019 21:15:32 +0000 (UTC)
commit 8ece7eb3a9df74ecc1232454167e7537f75a7903
Author: Philip Chimento <philip endlessm com>
Date: Tue Aug 27 11:47:09 2019 +0300
fundamental: Deal with missing introspection info
It's possible to have a fundamental type that isn't exposed to GObject
introspection and so has no introspection info. In that case, we should
assume that it has 0 constructor arguments since there's no other way to
tell.
This case would otherwise log a critical.
gi/fundamental.cpp | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
---
diff --git a/gi/fundamental.cpp b/gi/fundamental.cpp
index da8f5a08..42568498 100644
--- a/gi/fundamental.cpp
+++ b/gi/fundamental.cpp
@@ -385,7 +385,9 @@ bool FundamentalPrototype::get_parent_proto(
// Overrides GIWrapperPrototype::constructor_nargs().
unsigned FundamentalPrototype::constructor_nargs(void) const {
- return g_callable_info_get_n_args(m_constructor_info);
+ if (m_constructor_info)
+ return g_callable_info_get_n_args(m_constructor_info);
+ return 0;
}
/*
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]