Bug 1876009 Comment 7 Edit History

Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.

It looks like we've got a user who hit a version of this crash recently, too, over in bp-ceda5af0-1d45-4721-952c-bf5680240126.  (Handy for seeing the exact lines of code linked from the backtrace.)

https://hg.mozilla.org/releases/mozilla-beta/file/190710fe87f9f6d48f6d39ac3aed4ed8b89ce3e6/layout/xul/nsXULPopupManager.cpp#l245

Based on that, it looks like `presContext` is probably nullptr here:
https://searchfox.org/mozilla-central/rev/b75080bb8b11844d18cb5f9ac6e68a866ef8e243/layout/xul/nsXULPopupManager.cpp#237-238,244-245
```cpp
nsPresContext* presContext =
    aItem->Frame()->PresContext()->GetRootPresContext();
...
nsCOMPtr<nsIWidget> rootWidget =
    presContext->GetRootPresContext()->GetRootWidget();
```
So I think we probably just need to null-check `presContext` before the last line that I quoted there (and bail out in whatever way makes sense if it's null).
It looks like we've got a user who hit a version of this crash recently, too, over in bp-ceda5af0-1d45-4721-952c-bf5680240126.  (Handy for seeing the exact lines of code linked from the backtrace.)

Based on that, it looks like `presContext` is probably nullptr here:
https://searchfox.org/mozilla-central/rev/b75080bb8b11844d18cb5f9ac6e68a866ef8e243/layout/xul/nsXULPopupManager.cpp#237-238,244-245
```cpp
nsPresContext* presContext =
    aItem->Frame()->PresContext()->GetRootPresContext();
...
nsCOMPtr<nsIWidget> rootWidget =
    presContext->GetRootPresContext()->GetRootWidget();
```
So I think we probably just need to null-check `presContext` before the last line that I quoted there (and bail out in whatever way makes sense if it's null).
It looks like we've got a user who hit a version of this crash recently, too, over in bp-ceda5af0-1d45-4721-952c-bf5680240126.  (Handy for seeing the exact lines of code linked from the backtrace in the crash report there.)

Based on that, it looks like `presContext` is probably nullptr here:
https://searchfox.org/mozilla-central/rev/b75080bb8b11844d18cb5f9ac6e68a866ef8e243/layout/xul/nsXULPopupManager.cpp#237-238,244-245
```cpp
nsPresContext* presContext =
    aItem->Frame()->PresContext()->GetRootPresContext();
...
nsCOMPtr<nsIWidget> rootWidget =
    presContext->GetRootPresContext()->GetRootWidget();
```
So I think we probably just need to null-check `presContext` before the last line that I quoted there (and bail out in whatever way makes sense if it's null).

Back to Bug 1876009 Comment 7