This project contains the SDK for the communication with the agrirouter. Everything you need for the onboarding process, secure communication and much more.
Apache License 2.0
2
stars
3
forks
source link
Set default array to OutboxResponse messages in order to fix error ac… #43
When service respond with string "[]", $outboxService->fetch() returns OutboxResponse with not initialized messages. It causes error when trying to access $outboxResponse->getMessages():
Exception 'Error' with message 'Typed property App\Dto\Messaging\Http\OutboxResponse::$messages must not be accessed before initialization'
There is no way to detect empty response to prevent php error.
When service respond with string
"[]"
,$outboxService->fetch()
returnsOutboxResponse
with not initialized messages. It causes error when trying to access$outboxResponse->getMessages()
:There is no way to detect empty response to prevent php error.
Setting default value fix this situation.