Skip to content

Commit 062faa1

Browse files
var-consta-maurice
authored andcommitted
Fix assertion incorrectly checking a moved-from rather than the moved-to object.
This should fix #85. Note that this _was_ covered by tests (checked manually). Presumably, because a moved-from `std::function` is in a valid but unspecified state, it might or might not be left empty, depending on the implementation. PiperOrigin-RevId: 324919105
1 parent bd7b283 commit 062faa1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

firestore/src/android/lambda_event_listener.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class LambdaEventListener : public EventListener<T> {
2020
public:
2121
LambdaEventListener(std::function<void(const T&, Error)> callback)
2222
: callback_(firebase::Move(callback)) {
23-
FIREBASE_ASSERT(callback);
23+
FIREBASE_ASSERT(callback_);
2424
}
2525

2626
void OnEvent(const T& value, Error error) override {
@@ -36,7 +36,7 @@ class LambdaEventListener<void> : public EventListener<void> {
3636
public:
3737
LambdaEventListener(std::function<void()> callback)
3838
: callback_(firebase::Move(callback)) {
39-
FIREBASE_ASSERT(callback);
39+
FIREBASE_ASSERT(callback_);
4040
}
4141

4242
void OnEvent(Error) override { callback_(); }

0 commit comments

Comments
 (0)