Skip to content
Snippets Groups Projects
Commit 0f7ce2bf authored by Johannes Goderbauer's avatar Johannes Goderbauer
Browse files

Loghistory lead to error when a value was null

parent bf53fc9f
No related branches found
No related tags found
No related merge requests found
......@@ -186,17 +186,17 @@ LogHistoryExecutor.prototype.execute = function ()
{
//TODO: CLOB-check should be done by viewing the structure column type
//use .trim() for "[CLOB]" check because in some case the value "[CLOB]\n" my be given
if (this.oldValues[i].trim() == "[CLOB]" || this.oldValues[i] == "")
if (this.oldValues[i] != null && (this.oldValues[i].trim() == "[CLOB]" || this.oldValues[i].trim() == ""))
description.push(translate.withArguments("%0 \"%1\"", [logfieldTitle + ":", this.newValues[i]], this.translationLanguage));
else
description.push(translate.withArguments("%0 from \"%1\" to \"%2\"", [logfieldTitle + ":", this.oldValues[i], this.newValues[i]], this.translationLanguage));
}
//use .trim() for "[CLOB]" check because in some case the value "[CLOB]\n" my be given
if (this.sqlAction == 'I' && this.newValues[i] != "" && this.newValues[i].trim() != "[CLOB]")
if (this.sqlAction == 'I' && this.newValues[i] != "" && this.newValues[i] != null && this.newValues[i].trim() != "[CLOB]")
description.push(logfieldTitle + ": \"" + this.newValues[i] + "\"");
//use .trim() for "[CLOB]" check because in some case the value "[CLOB]\n" my be given
if (this.sqlAction == 'D' && this.oldValues[i] != "" && this.oldValues[i].trim() != "[CLOB]")
if (this.sqlAction == 'D' && this.oldValues[i] != "" && this.oldValues[i] != null && this.oldValues[i].trim() != "[CLOB]")
description.push(logfieldTitle + ": \"" + this.oldValues[i] + "\"");
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment