Fix Uncaught TypeError: Cannot read property 'length' of null

https://app.getsentry.com/id/id/group/5208581/
This commit is contained in:
John Firebaugh
2013-04-23 19:38:31 -07:00
parent 01238a49db
commit 7445b554e8

View File

@@ -60,7 +60,7 @@ iD.util.prefixCSSProperty = function(property) {
iD.util.getStyle = function(selector) {
for (var i = 0; i < document.styleSheets.length; i++) {
var rules = document.styleSheets[i].rules || document.styleSheets[i].cssRules;
var rules = document.styleSheets[i].rules || document.styleSheets[i].cssRules || [];
for (var k = 0; k < rules.length; k++) {
var selectorText = rules[k].selectorText && rules[k].selectorText.split(', ');
if (_.contains(selectorText, selector)) {