From b9b4af505a8f6abae7167bdff39d88c484d51aa7 Mon Sep 17 00:00:00 2001 From: wout Date: Mon, 1 Jul 2013 08:26:18 +0100 Subject: Fix in SVG.Number for IE --- src/number.js | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) (limited to 'src') diff --git a/src/number.js b/src/number.js index 8cbf93a..8ca1422 100644 --- a/src/number.js +++ b/src/number.js @@ -13,16 +13,18 @@ SVG.Number = function(value) { case 'string': var match = value.match(SVG.regex.unit) - /* make value numeric */ - this.value = parseFloat(match[1]) - - /* normalize percent value */ - if (match[2] == '%') - this.value /= 100 - - /* store unit */ - this.unit = match[2] - + if (match) { + /* make value numeric */ + this.value = parseFloat(match[1]) + + /* normalize percent value */ + if (match[2] == '%') + this.value /= 100 + + /* store unit */ + this.unit = match[2] + } + break default: if (value instanceof SVG.Number) { -- cgit v1.2.3