diff --git a/dom/base/Document.cpp b/dom/base/Document.cpp index 796ef43988c2..ca5d997a2f9f 100644 --- a/dom/base/Document.cpp +++ b/dom/base/Document.cpp @@ -13527,7 +13527,7 @@ Element* Document::TopLayerPop(FunctionRef aPredicateFunc) { // Remove the topmost element that qualifies aPredicate; This // is required is because the top layer contains not only // fullscreen elements, but also dialog elements. - Element* removedElement; + Element* removedElement = nullptr; for (auto i : Reversed(IntegerRange(mTopLayer.Length()))) { nsCOMPtr element(do_QueryReferent(mTopLayer[i])); if (element && aPredicateFunc(element)) {