[banshee/gtk3] GSettings: add a couple of null argument checking to the extractor
- From: Andrés Aragoneses <aaragoneses src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [banshee/gtk3] GSettings: add a couple of null argument checking to the extractor
- Date: Mon, 1 Apr 2013 06:24:06 +0000 (UTC)
commit 4e0ce13285e8c5462e83c905a44781736bc75217
Author: Andres G. Aragoneses <knocte gmail com>
Date: Mon Apr 1 07:23:53 2013 +0100
GSettings: add a couple of null argument checking to the extractor
These turned to be useful when implementing the previously committed bugfix.
build/GSettingsSchemaExtractor.cs | 8 ++++++++
1 files changed, 8 insertions(+), 0 deletions(-)
---
diff --git a/build/GSettingsSchemaExtractor.cs b/build/GSettingsSchemaExtractor.cs
index b597d97..b4ecc80 100644
--- a/build/GSettingsSchemaExtractor.cs
+++ b/build/GSettingsSchemaExtractor.cs
@@ -146,6 +146,10 @@ public class GSettingsSchemaExtractorProgram
private static string GetGcType (Type type)
{
+ if (type == null) {
+ throw new ArgumentNullException ("type");
+ }
+
// gctypes to return taken from
http://developer.gnome.org/glib/unstable/glib-GVariant.html#GVariantClass
if (type == typeof (bool)) {
@@ -204,6 +208,10 @@ public class GSettingsSchemaExtractorProgram
internal static GSettingsKey ExtractFromField (SchemaSet schemaSet, FieldInfo field)
{
+ if (field == null) {
+ throw new ArgumentNullException ("field");
+ }
+
object schema = field.GetValue (null);
if (schema == null) {
throw new InvalidSchemaException (String.Format (
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]