Skip to content

Commit 704bc54

Browse files
authored
Remove assert when passing null to instance manager (#348)
1 parent 49223a9 commit 704bc54

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

app/src/cpp_instance_manager.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,11 +85,9 @@ class CppInstanceManager {
8585
CppInstanceManager& operator=(CppInstanceManager&&) = delete;
8686

8787
/// @brief Increase the reference count by 1.
88-
/// @return Reference count after increment.
88+
/// @return Reference count after increment. Return -1 if invalid instance.
8989
int AddReference(InstanceClass* instance) {
90-
FIREBASE_DEV_ASSERT_MESSAGE(instance,
91-
"Null pointer is passed to AddReference<%s>().",
92-
typeid(InstanceClass).name());
90+
if (!instance) return -1;
9391
MutexLock lock(manager_mutex_);
9492
auto it = container_.find(instance);
9593
if (it != container_.end()) {

0 commit comments

Comments
 (0)