Bug 1205833 - Don't log an error if we did not store any datareporting policy notify date yet. r=dexter

This commit is contained in:
Georg Fritzsche 2015-09-18 13:17:16 +07:00
parent 9d479244a0
commit 1b25f70430

View File

@ -184,16 +184,17 @@ var TelemetryReportingPolicyImpl = {
* @return {Object} A date object or null on errors.
*/
get dataSubmissionPolicyNotifiedDate() {
if (!Preferences.has(PREF_ACCEPTED_POLICY_DATE)) {
let prefString = Preferences.get(PREF_ACCEPTED_POLICY_DATE, "0");
let valueInteger = parseInt(prefString, 10);
// Bail out if we didn't store any value yet.
if (valueInteger == 0) {
this._log.info("get dataSubmissionPolicyNotifiedDate - No date stored yet.");
return null;
}
let prefString = Preferences.get(PREF_ACCEPTED_POLICY_DATE, 0);
let valueInteger = parseInt(prefString, 10);
// If nothing or an invalid value is saved in the prefs, bail out.
if (Number.isNaN(valueInteger) || valueInteger == 0) {
// If an invalid value is saved in the prefs, bail out too.
if (Number.isNaN(valueInteger)) {
this._log.error("get dataSubmissionPolicyNotifiedDate - Invalid date stored.");
return null;
}