From 82c672f48e199ec82f89eecf860ea72a366963ff Mon Sep 17 00:00:00 2001 From: Lev Brouk Date: Mon, 29 Apr 2024 07:07:20 -0700 Subject: [PATCH] PR feedback: changes to _subscribe wrapper --- src/js.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/js.c b/src/js.c index 80dce2365..e6ffcf5fd 100644 --- a/src/js.c +++ b/src/js.c @@ -2764,12 +2764,12 @@ _subscribe(natsSubscription **new_sub, jsCtx *js, const char *subject, const cha natsMsgHandler usrCB, void *usrCBClosure, bool isPullMode, jsOptions *jsOpts, jsSubOptions *opts, jsErrCode *errCode) { + natsStatus s = NATS_OK; const char *subjects[] = {subject}; + int numSubjects = nats_IsStringEmpty(subject) ? 0 : 1; - if (nats_IsStringEmpty(subject)) - return _subscribeMulti(new_sub, js, NULL, 0, pullDurable, usrCB, usrCBClosure, isPullMode, jsOpts, opts, errCode); - - return _subscribeMulti(new_sub, js, subjects, 1, pullDurable, usrCB, usrCBClosure, isPullMode, jsOpts, opts, errCode); + s = _subscribeMulti(new_sub, js, subjects, numSubjects, pullDurable, usrCB, usrCBClosure, isPullMode, jsOpts, opts, errCode); + return NATS_UPDATE_ERR_STACK(s); } natsStatus