Fix create execution request filter from previous SDK version

When an older SDK executes a function without passing any data, the
data param is unset/null so we need to make sure to handle that case.
This commit is contained in:
Steven Nguyen 2023-09-04 16:10:49 -07:00
parent 4e00f61519
commit 65e2e79457
No known key found for this signature in database
2 changed files with 7 additions and 1 deletions

View file

@ -17,7 +17,7 @@ class V16 extends Filter
$content['commands'] = $this->getCommands($content['runtime'] ?? '');
break;
case 'functions.createExecution':
$content['body'] = $content['data'];
$content['body'] = $content['data'] ?? '';
unset($content['data']);
break;
}

View file

@ -34,6 +34,12 @@ class V16Test extends TestCase
'body' => 'Lorem ipsum'
],
],
'no data' => [
[],
[
'body' => ''
],
],
];
}