Catch null pointer for uninitialized dates

This commit is contained in:
Don Mitchell
2013-02-06 10:23:29 -05:00
parent 4ba7de3402
commit 1cc62fae75

View File

@@ -242,7 +242,7 @@ CMS.Views.Settings.Details = CMS.Views.ValidatingView.extend({
time = 0;
}
var newVal = new Date(date.getTime() + time * 1000);
if (cacheModel.get(fieldName).getTime() !== newVal.getTime()) {
if (!cacheModel.has(fieldName) || cacheModel.get(fieldName).getTime() !== newVal.getTime()) {
cacheModel.save(fieldName, newVal, { error: CMS.ServerError});
}
}