Bug 747245: Fix a silly weak reference assertion. r=bent a=mfinkle

This commit is contained in:
Kyle Huey 2012-04-23 14:14:10 -07:00
Родитель b1a0514299
Коммит 92426a49b8
1 изменённых файлов: 4 добавлений и 2 удалений

Просмотреть файл

@ -60,8 +60,10 @@ nsresult xpcJSWeakReference::Init(JSContext* cx, const JS::Value& object)
// See if the object is a wrapped native that supports weak references.
nsISupports* supports =
nsXPConnect::GetXPConnect()->GetNativeOfWrapper(cx, &obj);
if (supports) {
mReferent = do_GetWeakReference(supports);
nsCOMPtr<nsISupportsWeakReference> supportsWeakRef =
do_QueryInterface(supports);
if (supportsWeakRef) {
supportsWeakRef->GetWeakReference(getter_AddRefs(mReferent));
if (mReferent) {
return NS_OK;
}