warn when trying to add an undefined guid to the tracker's changes list

This commit is contained in:
Dan Mills 2009-01-02 16:17:09 -08:00
parent 5968d4080e
commit 87460d1ad0

View File

@ -166,6 +166,10 @@ Tracker.prototype = {
addChangedID: function T_addChangedID(id) { addChangedID: function T_addChangedID(id) {
if (!this.enabled) if (!this.enabled)
return; return;
if (!id) {
this._log.warn("Attempted to add undefined ID to tracker");
return;
}
this._log.debug("Adding changed ID " + id); this._log.debug("Adding changed ID " + id);
if (!this.changedIDs[id]) { if (!this.changedIDs[id]) {
this.changedIDs[id] = true; this.changedIDs[id] = true;
@ -176,6 +180,10 @@ Tracker.prototype = {
removeChangedID: function T_removeChangedID(id) { removeChangedID: function T_removeChangedID(id) {
if (!this.enabled) if (!this.enabled)
return; return;
if (!id) {
this._log.warn("Attempted to remove undefined ID from tracker");
return;
}
this._log.debug("Removing changed ID " + id); this._log.debug("Removing changed ID " + id);
if (this.changedIDs[id]) { if (this.changedIDs[id]) {
delete this.changedIDs[id]; delete this.changedIDs[id];