basis-company / nats.php

nats jetstream client for php
126 stars 30 forks source link

Allow empty message #66

Closed tlebreton closed 7 months ago

tlebreton commented 7 months ago

Hello

Since the last version we can't publish empty string or null as a payload we will get the following error :

Message: Typed property Basis\Nats\Message\Msg::$payload must not be accessed before initialization
File: /opt/project/BACKEND/vendor/basis-company/nats/src/Client.php
Line: 344
Trace: #0 /opt/project/BACKEND/vendor/basis-company/nats/src/Client.php(323): Basis\Nats\Client->onMessage(Object(Basis\Nats\Message\Msg), true)

Thanks for the work for this library :)

ro0NL commented 7 months ago

ref #64

nekufa commented 7 months ago

hi @tlebreton, sorry for delay, was on a vacation :) thanks for the fix!