[drwright] Replace assert with type sanity check
- From: Christian Persch <chpe src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [drwright] Replace assert with type sanity check
- Date: Thu, 29 Sep 2011 20:13:39 +0000 (UTC)
commit de099fe9ff134ab8141c22f083bcb88f319f9774
Author: Christian Persch <chpe gnome org>
Date: Thu Sep 29 22:10:19 2011 +0200
Replace assert with type sanity check
src/drw-cc-panel.c | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/src/drw-cc-panel.c b/src/drw-cc-panel.c
index 1e4f404..f728f5c 100644
--- a/src/drw-cc-panel.c
+++ b/src/drw-cc-panel.c
@@ -247,7 +247,10 @@ drw_cc_panel_register_type (GTypeModule *module)
};
parent_type = g_type_from_name ("CcPanel");
- g_assert (parent_type != G_TYPE_INVALID);
+ if (parent_type == 0 || !g_type_is_a (parent_type, GTK_TYPE_WIDGET)) {
+ drw_cc_panel_type = G_TYPE_INVALID;
+ return;
+ }
g_type_query (parent_type, &query);
type_info.class_size = query.class_size;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]