From 8afe3a9501f673b7d3fd0e74b732118f5ba0ebf8 Mon Sep 17 00:00:00 2001 From: Andrea Marchesini Date: Tue, 4 Aug 2020 10:01:09 +0000 Subject: [PATCH] Bug 1656980 - CookieService::GetCookiesSince needs to check the CookieService initialization state, r=mayhemer Differential Revision: https://phabricator.services.mozilla.com/D85824 --- netwerk/cookie/CookieService.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/netwerk/cookie/CookieService.cpp b/netwerk/cookie/CookieService.cpp index f624393f084b..a2deb4497c7e 100644 --- a/netwerk/cookie/CookieService.cpp +++ b/netwerk/cookie/CookieService.cpp @@ -2237,6 +2237,10 @@ class CompareCookiesCreationTime { NS_IMETHODIMP CookieService::GetCookiesSince(int64_t aSinceWhen, nsTArray>& aResult) { + if (!IsInitialized()) { + return NS_OK; + } + mPersistentStorage->EnsureReadComplete(); // We expose only non-private cookies.