cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From purplecabb...@apache.org
Subject git commit: CB-5435 Handle missing preferences gracefully
Date Mon, 18 Nov 2013 22:55:19 GMT
Updated Branches:
  refs/heads/master f1be30869 -> 25aa7897e


CB-5435 Handle missing preferences gracefully


Project: http://git-wip-us.apache.org/repos/asf/cordova-wp8/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-wp8/commit/25aa7897
Tree: http://git-wip-us.apache.org/repos/asf/cordova-wp8/tree/25aa7897
Diff: http://git-wip-us.apache.org/repos/asf/cordova-wp8/diff/25aa7897

Branch: refs/heads/master
Commit: 25aa7897e38ef6a61f42524982ba61ae540b7c8b
Parents: f1be308
Author: purplecabbage <purplecabbage@gmail.com>
Authored: Mon Nov 18 14:54:47 2013 -0800
Committer: purplecabbage <purplecabbage@gmail.com>
Committed: Mon Nov 18 14:54:47 2013 -0800

----------------------------------------------------------------------
 wp7/template/cordovalib/ConfigHandler.cs |  2 +-
 wp8/template/cordovalib/ConfigHandler.cs | 10 +++++-----
 2 files changed, 6 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-wp8/blob/25aa7897/wp7/template/cordovalib/ConfigHandler.cs
----------------------------------------------------------------------
diff --git a/wp7/template/cordovalib/ConfigHandler.cs b/wp7/template/cordovalib/ConfigHandler.cs
index 05829b5..cd59e59 100644
--- a/wp7/template/cordovalib/ConfigHandler.cs
+++ b/wp7/template/cordovalib/ConfigHandler.cs
@@ -42,7 +42,7 @@ namespace WPCordovaClassLib.CordovaLib
 
         public string GetPreference(string key)
         {
-            return Preferences[key];
+            return Preferences.ContainsKey(key) ? Preferences[key] : null;
         }
 
         protected static string[] AllowedSchemes = {"http","https","ftp","ftps"};

http://git-wip-us.apache.org/repos/asf/cordova-wp8/blob/25aa7897/wp8/template/cordovalib/ConfigHandler.cs
----------------------------------------------------------------------
diff --git a/wp8/template/cordovalib/ConfigHandler.cs b/wp8/template/cordovalib/ConfigHandler.cs
index fcb8665..c094575 100644
--- a/wp8/template/cordovalib/ConfigHandler.cs
+++ b/wp8/template/cordovalib/ConfigHandler.cs
@@ -42,7 +42,7 @@ namespace WPCordovaClassLib.CordovaLib
 
         public string GetPreference(string key)
         {
-            return Preferences[key];
+            return Preferences.ContainsKey(key) ? Preferences[key] : null;
         }
 
         protected static string[] AllowedSchemes = { "http", "https", "ftp", "ftps" };
@@ -73,7 +73,7 @@ namespace WPCordovaClassLib.CordovaLib
                 Uri uri = new Uri(origin.Replace("*", "replaced-text"), UriKind.Absolute);
 
                 string tempHostName = uri.Host.Replace("replaced-text", "*");
-                //if (uri.HostNameType == UriHostNameType.Dns){}        
+                //if (uri.HostNameType == UriHostNameType.Dns){}
                 // starts with wildcard match - we make the first '.' optional (so '*.org.apache.cordova'
will match 'org.apache.cordova')
                 if (tempHostName.StartsWith("*."))
                 {    //"(\\s{0}|*.)"
@@ -96,15 +96,15 @@ namespace WPCordovaClassLib.CordovaLib
 
         }
 
-        /**   
-         
+        /**
+
          An access request is granted for a given URI if there exists an item inside the
access-request list such that:
 
             - The URI's scheme component is the same as scheme; and
             - if subdomains is false or if the URI's host component is not a domain name
(as defined in [RFC1034]), the URI's host component is the same as host; or
             - if subdomains is true, the URI's host component is either the same as host,
or is a subdomain of host (as defined in [RFC1034]); and
             - the URI's port component is the same as port.
-         
+
          **/
 
         public bool URLIsAllowed(string url)


Mime
View raw message