Update to avoid NPE if used without a callback (e.g., scheduled process)

This commit is contained in:
2023-11-08 07:54:55 -06:00
parent 724e9c024e
commit 55725a6cca

View File

@ -49,14 +49,17 @@ public class LoadInitialRecordsStep implements BackendStep
@Override @Override
public void run(RunBackendStepInput runBackendStepInput, RunBackendStepOutput runBackendStepOutput) throws QException public void run(RunBackendStepInput runBackendStepInput, RunBackendStepOutput runBackendStepOutput) throws QException
{ {
///////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////////////
// basically this is a no-op... we Just need a backendStep to be the first step in the process // // basically this is a no-op... sometimes we just need a backendStep to be the first step in a process. //
// but, while we're here, go ahead and put the query filter in the payload as a value, in case // // While we're here, go ahead and put the query filter in the payload as a value - this is needed for //
// someone else wants it (see BulkDelete) // // processes that have a screen before their first backend step (why is this needed? not sure, but is) //
///////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////////////
runBackendStepInput.getAsyncJobCallback().updateStatus("Loading records"); runBackendStepInput.getAsyncJobCallback().updateStatus("Loading records");
QQueryFilter queryFilter = runBackendStepInput.getCallback().getQueryFilter(); if(runBackendStepInput.getCallback() != null)
runBackendStepOutput.addValue("queryFilterJson", JsonUtils.toJson(queryFilter)); {
QQueryFilter queryFilter = runBackendStepInput.getCallback().getQueryFilter();
runBackendStepOutput.addValue("queryFilterJson", JsonUtils.toJson(queryFilter));
}
} }