[sword-svn] r3671 - trunk/bindings/cordova/cordova-plugin-crosswire-sword/www

scribe at crosswire.org scribe at crosswire.org
Thu Jul 4 11:25:00 MST 2019


Author: scribe
Date: 2019-07-04 11:25:00 -0700 (Thu, 04 Jul 2019)
New Revision: 3671

Modified:
   trunk/bindings/cordova/cordova-plugin-crosswire-sword/www/SWORD.js
Log:
Handle cases where modName supplied doesn't exist in library.


Modified: trunk/bindings/cordova/cordova-plugin-crosswire-sword/www/SWORD.js
===================================================================
--- trunk/bindings/cordova/cordova-plugin-crosswire-sword/www/SWORD.js	2019-07-03 21:12:24 UTC (rev 3670)
+++ trunk/bindings/cordova/cordova-plugin-crosswire-sword/www/SWORD.js	2019-07-04 18:25:00 UTC (rev 3671)
@@ -61,7 +61,7 @@
 
 InstallMgr.prototype.getRemoteModuleByName = function(sourceName, modName, callback) {
 	var mod = null;
-	exec(function(m) { if (m.name) mod = new SWModule(m); if (callback) callback(mod); },
+	exec(function(m) { if (m && m.name) mod = new SWModule(m); if (callback) callback(mod); },
 		function(err) { utils.alert('[ERROR] problem: ' + err); },
 		"SWORD", "InstallMgr_getRemoteModuleByName", [sourceName, modName]
 	);
@@ -276,7 +276,7 @@
 
 SWMgr.prototype.getModuleByName = function(modName, callback) {
 	var mod = null;
-	exec(function(m) { if (m.name) mod = new SWModule(m); if (callback) callback(mod); },
+	exec(function(m) { if (m && m.name) mod = new SWModule(m); if (callback) callback(mod); },
 		function(err) { utils.alert('[ERROR] problem: ' + err); },
 		"SWORD", "SWMgr_getModuleByName", [modName]
 	);




More information about the sword-cvs mailing list