Avoid calling clearTimeout with an invalid id in the buddy list (for compatibility with the jsProtoHelper module if an add-on ever wants to include it there).

This commit is contained in:
Florian Quèze 2011-06-15 16:26:21 +02:00
Родитель 46c9efccda
Коммит b4c2d5e2fc
1 изменённых файлов: 3 добавлений и 1 удалений

Просмотреть файл

@ -448,7 +448,8 @@ var buddyList = {
statusMessageRefreshTimer: function bl_statusMessageRefreshTimer() { statusMessageRefreshTimer: function bl_statusMessageRefreshTimer() {
const timeBeforeAutoValidate = 20 * 1000; const timeBeforeAutoValidate = 20 * 1000;
clearTimeout(this._stopEditStatusTimeout); if ("_stopEditStatusTimeout" in this)
clearTimeout(this._stopEditStatusTimeout);
this._stopEditStatusTimeout = setTimeout(this.finishEditStatusMessage, this._stopEditStatusTimeout = setTimeout(this.finishEditStatusMessage,
timeBeforeAutoValidate, true); timeBeforeAutoValidate, true);
}, },
@ -476,6 +477,7 @@ var buddyList = {
finishEditStatusMessage: function bl_finishEditStatusMessage(aSave) { finishEditStatusMessage: function bl_finishEditStatusMessage(aSave) {
clearTimeout(this._stopEditStatusTimeout); clearTimeout(this._stopEditStatusTimeout);
delete this._stopEditStatusTimeout;
let elt = document.getElementById("statusMessage"); let elt = document.getElementById("statusMessage");
if (aSave) { if (aSave) {
let newStatus = Ci.imIStatusInfo.STATUS_UNKNOWN; let newStatus = Ci.imIStatusInfo.STATUS_UNKNOWN;