mirror of
https://github.com/Kingsrook/qqq.git
synced 2025-07-18 13:10:44 +00:00
Avoid NPE if adding a log line before the script header is set
This commit is contained in:
@ -94,7 +94,7 @@ public class BuildScriptLogAndScriptLogLineExecutionLogger implements QCodeExecu
|
|||||||
protected QRecord buildDetailLogRecord(String logLine)
|
protected QRecord buildDetailLogRecord(String logLine)
|
||||||
{
|
{
|
||||||
return (new QRecord()
|
return (new QRecord()
|
||||||
.withValue("scriptLogId", scriptLog.getValue("id"))
|
.withValue("scriptLogId", scriptLog == null ? null : scriptLog.getValue("id"))
|
||||||
.withValue("timestamp", Instant.now())
|
.withValue("timestamp", Instant.now())
|
||||||
.withValue("text", truncate(logLine)));
|
.withValue("text", truncate(logLine)));
|
||||||
}
|
}
|
||||||
@ -145,6 +145,14 @@ public class BuildScriptLogAndScriptLogLineExecutionLogger implements QCodeExecu
|
|||||||
{
|
{
|
||||||
this.executeCodeInput = executeCodeInput;
|
this.executeCodeInput = executeCodeInput;
|
||||||
this.scriptLog = buildHeaderRecord(executeCodeInput);
|
this.scriptLog = buildHeaderRecord(executeCodeInput);
|
||||||
|
|
||||||
|
if(scriptLogLines != null)
|
||||||
|
{
|
||||||
|
for(QRecord scriptLogLine : scriptLogLines)
|
||||||
|
{
|
||||||
|
scriptLogLine.setValue("scriptLogId", scriptLog.getValue("id"));
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
catch(Exception e)
|
catch(Exception e)
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user