Skip to content

Wrong logic for initializing _err_sub and _throttle_sub #113

Open
@kintel

Description

@kintel

See this code fragment:

if (_err_sub) {
// setup error sub
_err_sub = new Adafruit_MQTT_Subscribe(_mqtt, _err_topic);
_mqtt->subscribe(_err_sub);
_err_sub->setCallback(errorCallback);
}

_err_sub is only initialized if it's non-NULL, which is the opposite of what I'd expect.
Same for _throttle_sub.

As an aside, this will never actually be executed, as both are initialized to 0.
It doesn't look like this is the intended behavior of this code.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions