CB-11645 added check to see if getEditConfig exists before trying to use it
authorSteve Gill <stevengill97@gmail.com>
Sat, 30 Jul 2016 00:16:02 +0000 (17:16 -0700)
committerSteve Gill <stevengill97@gmail.com>
Tue, 2 Aug 2016 00:14:54 +0000 (17:14 -0700)
src/ConfigChanges/ConfigChanges.js

index a395c6d..e5b09a7 100644 (file)
@@ -97,7 +97,10 @@ function remove_plugin_changes(pluginInfo, is_top_level) {
     var plugin_vars = is_top_level ?
         platform_config.installed_plugins[pluginInfo.id] :
         platform_config.dependent_plugins[pluginInfo.id];
-    var edit_config_changes = pluginInfo.getEditConfigs(self.platform);
+    var edit_config_changes = null;
+    if(pluginInfo.getEditConfigs) {
+        edit_config_changes = pluginInfo.getEditConfigs(self.platform);
+    }
 
     // get config munge, aka how did this plugin change various config files
     var config_munge = self.generate_plugin_config_munge(pluginInfo, plugin_vars, edit_config_changes);
@@ -131,7 +134,12 @@ PlatformMunger.prototype.add_plugin_changes = add_plugin_changes;
 function add_plugin_changes(pluginInfo, plugin_vars, is_top_level, should_increment, plugin_force) {
     var self = this;
     var platform_config = self.platformJson.root;
-    var edit_config_changes = pluginInfo.getEditConfigs(self.platform);
+
+    var edit_config_changes = null;
+    if(pluginInfo.getEditConfigs) {
+        edit_config_changes = pluginInfo.getEditConfigs(self.platform);
+    }
+
     var config_munge;
 
     if (!edit_config_changes || edit_config_changes.length === 0) {