on xenial help sign in
Fix some "Cannot read property 'luminance' of null" warnings
commit31909f685faf1c885e0a1fb7dc7044509971ef50 authorAlbert Astals <albert.astals@canonical.com> dateFri 29 Aug 2014, 10:19 (12 years ago) parentf9648cc
1 file changed+2−2
plugins/Dash/CardCreator.js+2−2
plugins/Dash/CardCreator.js+2−2
@@ -440,14 +440,14 @@ function cardString(template, components) {
440440 mascotCode = kMascotImageCode.arg(mascotAnchors).arg(mascotImageVisible);
441441 }
442442
443− var summaryColorWithBackground = 'backgroundLoader.active && backgroundLoader.item && root.scopeStyle ? root.scopeStyle.getTextColor(backgroundLoader.item.luminance) : (backgroundLoader.item.luminance > 0.7 ? Theme.palette.normal.baseText : "white")';
443+ var summaryColorWithBackground = 'backgroundLoader.active && backgroundLoader.item && root.scopeStyle ? root.scopeStyle.getTextColor(backgroundLoader.item.luminance) : (backgroundLoader.item && backgroundLoader.item.luminance > 0.7 ? Theme.palette.normal.baseText : "white")';
444444
445445 var hasTitleContainer = hasTitle && (hasEmblem || (hasMascot && (hasSubtitle || hasAttributes)));
446446 var titleSubtitleCode = '';
447447 if (hasTitle) {
448448 var titleColor;
449449 if (headerAsOverlay) {
450− titleColor = 'root.scopeStyle ? root.scopeStyle.getTextColor(overlayLoader.item.luminance) : (overlayLoader.item.luminance > 0.7 ? Theme.palette.normal.baseText : "white")';
450+ titleColor = 'root.scopeStyle && overlayLoader.item ? root.scopeStyle.getTextColor(overlayLoader.item.luminance) : (overlayLoader.item && overlayLoader.item.luminance > 0.7 ? Theme.palette.normal.baseText : "white")';
451451 } else if (hasSummary) {
452452 titleColor = 'summary.color';
453453 } else if (hasBackground) {