cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ste...@apache.org
Subject [5/8] cordova-lib git commit: don't crash when parsing general plugin names
Date Sat, 05 Dec 2015 01:26:59 GMT
don't crash when parsing general plugin names


Project: http://git-wip-us.apache.org/repos/asf/cordova-lib/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-lib/commit/877404bb
Tree: http://git-wip-us.apache.org/repos/asf/cordova-lib/tree/877404bb
Diff: http://git-wip-us.apache.org/repos/asf/cordova-lib/diff/877404bb

Branch: refs/heads/master
Commit: 877404bbcb2d84cbb9cade8e692396237cc586f3
Parents: 1bbf544
Author: David Barth <david.barth@canonical.com>
Authored: Wed Dec 2 21:18:28 2015 +0100
Committer: David Barth <david.barth@canonical.com>
Committed: Wed Dec 2 21:18:28 2015 +0100

----------------------------------------------------------------------
 cordova-lib/src/plugman/platforms/ubuntu.js | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/877404bb/cordova-lib/src/plugman/platforms/ubuntu.js
----------------------------------------------------------------------
diff --git a/cordova-lib/src/plugman/platforms/ubuntu.js b/cordova-lib/src/plugman/platforms/ubuntu.js
index 06cac97..c34e218 100644
--- a/cordova-lib/src/plugman/platforms/ubuntu.js
+++ b/cordova-lib/src/plugman/platforms/ubuntu.js
@@ -67,8 +67,11 @@ function findClassName(pluginxml, plugin_id) {
         class_name = plugin_id.match(/\.[^.]+$/)[0].substr(1);
         class_name = toCamelCase(class_name);
     } else {
-        class_name = plugin_id.match(/cordova\-plugin\-([\w\-]+)$/)[0].substr(15);
-        class_name = toCamelCase(class_name);
+	match = plugin_id.match(/cordova\-plugin\-([\w\-]+)$/);
+        if (match && match.length > 0)
+	    class_name = match[0].substr(15);
+	else
+            class_name = toCamelCase(class_name);
     }
 
     return class_name;


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


Mime
View raw message