mirror of
https://github.com/Kingsrook/qqq.git
synced 2025-07-18 13:10:44 +00:00
Avoid NPE on empty input record
This commit is contained in:
@ -94,7 +94,7 @@ public class QRecordApiAdapter
|
||||
for(QRecord record : records)
|
||||
{
|
||||
ApiOutputMapWrapper apiOutputMap = qRecordToApiMap(record, tableName, apiName, apiVersion, fieldValueMappers, new ApiOutputMapWrapper(new LinkedHashMap<>()));
|
||||
rs.add(apiOutputMap.getContents());
|
||||
rs.add(apiOutputMap == null ? null : apiOutputMap.getContents());
|
||||
}
|
||||
|
||||
return (rs);
|
||||
|
@ -39,6 +39,7 @@ import static org.assertj.core.api.Assertions.assertThatThrownBy;
|
||||
import static org.junit.jupiter.api.Assertions.assertArrayEquals;
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
import static org.junit.jupiter.api.Assertions.assertFalse;
|
||||
import static org.junit.jupiter.api.Assertions.assertNull;
|
||||
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||
|
||||
|
||||
@ -48,6 +49,17 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||
class QRecordApiAdapterTest extends BaseTest
|
||||
{
|
||||
|
||||
/*******************************************************************************
|
||||
**
|
||||
*******************************************************************************/
|
||||
@Test
|
||||
void testNullInputRecord() throws QException
|
||||
{
|
||||
assertNull(QRecordApiAdapter.qRecordToApiMap(null, TestUtils.TABLE_NAME_PERSON, TestUtils.API_NAME, TestUtils.V2022_Q4));
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
**
|
||||
*******************************************************************************/
|
||||
|
Reference in New Issue
Block a user