bug 1528034, make IsHostOrSlot null-safe, r=enn a=lizzard
authorOlli Pettay <Olli.Pettay@helsinki.fi>
Sun, 17 Feb 2019 16:39:09 +0200
changeset 516171 20cd9dd27bfc31a54f8451837f941891374d3363
parent 516170 aecc839fd41caf60a010626eb209deccdbf859ef
child 516172 4171deeda04bb446358cc6d6c76bd6cf4f0cd45f
push id1953
push userffxbld-merge
push dateMon, 11 Mar 2019 12:10:20 +0000
treeherdermozilla-release@9c35dcbaa899 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersenn, lizzard
bugs1528034
milestone66.0
bug 1528034, make IsHostOrSlot null-safe, r=enn a=lizzard
dom/base/nsFocusManager.cpp
--- a/dom/base/nsFocusManager.cpp
+++ b/dom/base/nsFocusManager.cpp
@@ -2839,17 +2839,18 @@ nsresult nsFocusManager::DetermineElemen
     // to, so just break out
     if (startContent == originalStartContent) break;
   }
 
   return NS_OK;
 }
 
 static bool IsHostOrSlot(const nsIContent* aContent) {
-  return aContent->GetShadowRoot() || aContent->IsHTMLElement(nsGkAtoms::slot);
+  return aContent && (aContent->GetShadowRoot() ||
+                      aContent->IsHTMLElement(nsGkAtoms::slot));
 }
 
 // Helper class to iterate contents in scope by traversing flattened tree
 // in tree order
 class MOZ_STACK_CLASS ScopedContentTraversal {
  public:
   ScopedContentTraversal(nsIContent* aStartContent, nsIContent* aOwner)
       : mCurrent(aStartContent), mOwner(aOwner) {