Skip to content

Commit

Permalink
fix 3, --filter=[unit]
Browse files Browse the repository at this point in the history
  • Loading branch information
matyhtf committed Sep 26, 2024
1 parent 4afa565 commit 3928997
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ext-src/swoole_event.cc
Original file line number Diff line number Diff line change
Expand Up @@ -434,14 +434,14 @@ static PHP_FUNCTION(swoole_event_add) {
RETURN_FALSE;
}

auto readable_callback = sw_callable_create(zreadable_callback);
auto readable_callback = zreadable_callback ? sw_callable_create(zreadable_callback) : nullptr;
if ((events & SW_EVENT_READ) && readable_callback == nullptr) {
php_swoole_fatal_error(
E_WARNING, "%s: unable to find readable callback of fd [%d]", ZSTR_VAL(swoole_event_ce->name), socket_fd);
RETURN_FALSE;
}

auto writable_callback = sw_callable_create(zwritable_callback);
auto writable_callback = zwritable_callback ? sw_callable_create(zwritable_callback) : nullptr;
if ((events & SW_EVENT_WRITE) && writable_callback == nullptr) {
php_swoole_fatal_error(
E_WARNING, "%s: unable to find writable callback of fd [%d]", ZSTR_VAL(swoole_event_ce->name), socket_fd);
Expand Down

0 comments on commit 3928997

Please sign in to comment.