Commit eb7b3e3a by cjt

defend against None as parameter value in schematic tool

parent 7c922e69
...@@ -113,7 +113,7 @@ schematic = (function() { ...@@ -113,7 +113,7 @@ schematic = (function() {
// else just populate parts bin with all the parts // else just populate parts bin with all the parts
this.edits_allowed = true; this.edits_allowed = true;
var parts = input.getAttribute('parts'); var parts = input.getAttribute('parts');
if (parts == undefined) { if (parts == undefined || parts == 'None') {
parts = new Array(); parts = new Array();
for (var p in parts_map) parts.push(p); for (var p in parts_map) parts.push(p);
} else if (parts == '') { } else if (parts == '') {
...@@ -133,7 +133,8 @@ schematic = (function() { ...@@ -133,7 +133,8 @@ schematic = (function() {
// use user-supplied list of analyses, otherwise provide them all // use user-supplied list of analyses, otherwise provide them all
// analyses="" means no analyses // analyses="" means no analyses
var analyses = input.getAttribute('analyses'); var analyses = input.getAttribute('analyses');
if (analyses == undefined) analyses = ['dc','ac','tran']; if (analyses == undefined || analyses == 'None')
analyses = ['dc','ac','tran'];
else if (analyses == '') analyses = []; else if (analyses == '') analyses = [];
else analyses = analyses.split(','); else analyses = analyses.split(',');
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment