diff --git a/Nasal/canvas/svg.nas b/Nasal/canvas/svg.nas index fb733594f..536e20b53 100644 --- a/Nasal/canvas/svg.nas +++ b/Nasal/canvas/svg.nas @@ -422,7 +422,7 @@ var parsesvg = func(group, path, options = nil) { append(defs_stack, {'type': name, 'id': attr['id']}); } - else if( name == "rect" ) + else if( ishash(defs_stack[-1]) and name == "rect" ) { foreach(var p; ["x", "y", "width", "height"]) defs_stack[-1][p] = evalCSSNum(attr[p]);