Add null check to avoid crash in unit tests that use mock singletons.
authorAdrian Hamza <adriah@fb.com>
Mon, 9 Mar 2015 21:04:47 +0000 (14:04 -0700)
committerAndre Azevedo <aap@fb.com>
Wed, 18 Mar 2015 02:48:37 +0000 (19:48 -0700)
commit82bb86218da48157b405b3eacb916bb4acaf11f3
tree6f6343387b6e8cbc457bc957e569095948ddd46f
parente87194b349a6dc0c584911945f6f41dcbaa32b6b
Add null check to avoid crash in unit tests that use mock singletons.

Summary: Some unit tests owned by my team are failing due to segmentation fault in SingletonHolder<T>::registerSingletonMock -> SingletonHolder<T>::destroyInstance.

Test Plan: Run folly unit tests and my unit tests.

Reviewed By: henryf@fb.com

Subscribers: trunkagent, folly-diffs@, yfeldblum

FB internal diff: D1873889

Signature: t1:1873889:1425925156:29d54092939d7e9debea3fd55f7105fd320e987e

Blame Revision: 91f4942e
folly/experimental/Singleton-inl.h