Skip to content

Commit 55c5df6

Browse files
committed
Don't compare nullptr string - Fixes #120
In AdafruitIO_Group::call there is a comparison with the feedname of the update. If the onMessage() call didn't provide a feed name, the feed pointer is null. The code also checks for this, but it does it after comparing with a string. Reverse the check so a short-circuiting or can do the right thing.
1 parent 6ed54d3 commit 55c5df6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/AdafruitIO_Group.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@ void AdafruitIO_Group::call(AdafruitIO_Data *d) {
345345

346346
while (cur_cb) {
347347

348-
if (strcmp(cur_cb->feed, d->feedName()) == 0 || cur_cb->feed == NULL) {
348+
if (cur_cb->feed == NULL || strcmp(cur_cb->feed, d->feedName()) == 0) {
349349
cur_cb->dataCallback(d);
350350
}
351351

0 commit comments

Comments
 (0)