[glib/new-gsettings] Do not crash when converting a gconf schema with no default value
- From: Vincent Untz <vuntz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib/new-gsettings] Do not crash when converting a gconf schema with no default value
- Date: Sat, 17 Apr 2010 02:01:27 +0000 (UTC)
commit fd619f24e823934a92b5a9a771e7ec86015e0926
Author: Vincent Untz <vuntz gnome org>
Date: Fri Apr 16 21:59:55 2010 -0400
Do not crash when converting a gconf schema with no default value
gio/gsettings-schema-convert | 7 +++++--
1 files changed, 5 insertions(+), 2 deletions(-)
---
diff --git a/gio/gsettings-schema-convert b/gio/gsettings-schema-convert
index 0fd8149..079186b 100755
--- a/gio/gsettings-schema-convert
+++ b/gio/gsettings-schema-convert
@@ -325,8 +325,11 @@ class GConfSchema:
self.default = locale_node.find('default').text
self.localized = True
except:
- self.default = node.find('default').text
- self.localized = False
+ try:
+ self.default = node.find('default').text
+ self.localized = False
+ except:
+ raise GSettingsSchemaConvertException('No default value for \'%s\'. GSettings schemas require one default value.' % self.applyto or self.key)
self.typed_default = None
self.short = self._get_value_with_locale(node, locale_node, 'short')
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]