Fix index lookup in getValue().

This commit is contained in:
Jürg Lehni 2012-11-02 19:05:21 -07:00
parent 3c88614a86
commit 6937d4c3be

View file

@ -56,7 +56,7 @@ var SvgImporter = this.SvgImporter = new function() {
function getValue(svg, key, index) {
var base = svg[key].baseVal;
return index !== undefined
? base.numberOfItems > 0 ? base.getItem(index).value || 0 : 0
? index < base.numberOfItems ? base.getItem(index).value || 0 : 0
: base.value || 0;
}