Commit 6a952cba authored by Leszek Swirski's avatar Leszek Swirski Committed by Commit Bot

Handle null parser in inline code caching

Add a null check for document.GetScriptableDocumentParser() when getting
an inline cache handler.

Bug: chromium:841651
Change-Id: Ie34c23a49c5725766ddf75e5667eb1b2dc7c0baf
Reviewed-on: https://chromium-review.googlesource.com/1052698
Commit-Queue: Hiroshige Hayashizaki <hiroshige@chromium.org>
Reviewed-by: default avatarHiroshige Hayashizaki <hiroshige@chromium.org>
Cr-Commit-Position: refs/heads/master@{#558100}
parent 819127a0
...@@ -239,8 +239,13 @@ static SingleCachedMetadataHandler* GetInlineCacheHandler(const String& source, ...@@ -239,8 +239,13 @@ static SingleCachedMetadataHandler* GetInlineCacheHandler(const String& source,
if (!RuntimeEnabledFeatures::CacheInlineScriptCodeEnabled()) if (!RuntimeEnabledFeatures::CacheInlineScriptCodeEnabled())
return nullptr; return nullptr;
ScriptableDocumentParser* scriptable_parser =
document.GetScriptableDocumentParser();
if (!scriptable_parser)
return nullptr;
SourceKeyedCachedMetadataHandler* document_cache_handler = SourceKeyedCachedMetadataHandler* document_cache_handler =
document.GetScriptableDocumentParser()->GetInlineScriptCacheHandler(); scriptable_parser->GetInlineScriptCacheHandler();
if (!document_cache_handler) if (!document_cache_handler)
return nullptr; return nullptr;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment