mirror of
https://github.com/Kingsrook/qqq.git
synced 2025-07-18 05:01:07 +00:00
Make sure to always return an empty list rather than a null
This commit is contained in:
@ -132,6 +132,15 @@ public class InsertAction extends AbstractQActionFunction<InsertInput, InsertOut
|
|||||||
////////////////////////////////////
|
////////////////////////////////////
|
||||||
InsertOutput insertOutput = insertInterface.execute(insertInput);
|
InsertOutput insertOutput = insertInterface.execute(insertInput);
|
||||||
|
|
||||||
|
if(insertOutput.getRecords() == null)
|
||||||
|
{
|
||||||
|
////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
// in case the module failed to set record in the output, put an empty list there //
|
||||||
|
// to avoid so many downstream NPE's //
|
||||||
|
////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
insertOutput.setRecords(new ArrayList<>());
|
||||||
|
}
|
||||||
|
|
||||||
//////////////////////////////
|
//////////////////////////////
|
||||||
// log if there were errors //
|
// log if there were errors //
|
||||||
//////////////////////////////
|
//////////////////////////////
|
||||||
|
@ -137,6 +137,15 @@ public class UpdateAction
|
|||||||
////////////////////////////////////
|
////////////////////////////////////
|
||||||
UpdateOutput updateOutput = updateInterface.execute(updateInput);
|
UpdateOutput updateOutput = updateInterface.execute(updateInput);
|
||||||
|
|
||||||
|
if(updateOutput.getRecords() == null)
|
||||||
|
{
|
||||||
|
////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
// in case the module failed to set record in the output, put an empty list there //
|
||||||
|
// to avoid so many downstream NPE's //
|
||||||
|
////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
updateOutput.setRecords(new ArrayList<>());
|
||||||
|
}
|
||||||
|
|
||||||
//////////////////////////////
|
//////////////////////////////
|
||||||
// log if there were errors //
|
// log if there were errors //
|
||||||
//////////////////////////////
|
//////////////////////////////
|
||||||
|
Reference in New Issue
Block a user