From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Samuel Attard <samuel.r.attard@gmail.com>
Date: Fri, 18 Dec 2020 15:19:39 -0800
Subject: Don't use potentially null "GetWebFrame()->View()" when get blink
 prefs

For whatever reason (still haven't narrowed it down to an exact test case) when using OOPIFs the "GetWebFrame()->View()" call during "RenderFrameCreated" call be nullptr.  Accessing the prefs via the render_view though still works.

This regressed in https://chromium-review.googlesource.com/c/chromium/src/+/2572256

Upstream: https://chromium-review.googlesource.com/c/chromium/src/+/2598393

diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc
index b9eea3470139e1833b2b23d3b535b11235e2bc8e..fbc1f6d8387e33cb7daafc96b7514897f067f008 100644
--- a/content/renderer/render_frame_impl.cc
+++ b/content/renderer/render_frame_impl.cc
@@ -2377,7 +2377,7 @@ const blink::WebView* RenderFrameImpl::GetWebView() const {
 }
 
 const blink::web_pref::WebPreferences& RenderFrameImpl::GetBlinkPreferences() {
-  return GetWebView()->GetWebPreferences();
+  return render_view_->GetWebView()->GetWebPreferences();
 }
 
 const blink::RendererPreferences& RenderFrameImpl::GetRendererPreferences()
