fix : check undefined palette

This commit is contained in:
juliandescottes 2015-04-13 13:29:13 +02:00
parent f2f8158efb
commit d1b12a07ac

View File

@ -52,7 +52,7 @@
if (max) {
colorsArray = colorsArray.slice(0, Constants.MAX_CURRENT_COLORS_DISPLAYED);
}
return this.colorSorter.sort(colorsArray);
};
@ -60,7 +60,7 @@
var paletteId = pskl.UserSettings.get(pskl.UserSettings.SELECTED_PALETTE);
var palette = this.paletteService.getPaletteById(paletteId);
return palette.id === Constants.CURRENT_COLORS_PALETTE_ID;
return palette && palette.id === Constants.CURRENT_COLORS_PALETTE_ID;
};
ns.CurrentColorsService.prototype.loadColorsFromCache_ = function () {