Title: [258515] trunk/Source/WebKit
Revision
258515
Author
[email protected]
Date
2020-03-16 13:11:01 -0700 (Mon, 16 Mar 2020)

Log Message

[Cocoa] Crash under -[WKPreferenceObserver init]
https://bugs.webkit.org/show_bug.cgi?id=209145

Reviewed by Darin Adler.

Handle the case when calling [NSUserDefaults initWithSuiteName:] did not succeed.

No new tests, since I have not been able to reproduce.

* UIProcess/Cocoa/PreferenceObserver.mm:
(-[WKPreferenceObserver init]):

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (258514 => 258515)


--- trunk/Source/WebKit/ChangeLog	2020-03-16 19:57:45 UTC (rev 258514)
+++ trunk/Source/WebKit/ChangeLog	2020-03-16 20:11:01 UTC (rev 258515)
@@ -1,3 +1,17 @@
+2020-03-16  Per Arne Vollan  <[email protected]>
+
+        [Cocoa] Crash under -[WKPreferenceObserver init]
+        https://bugs.webkit.org/show_bug.cgi?id=209145
+
+        Reviewed by Darin Adler.
+
+        Handle the case when calling [NSUserDefaults initWithSuiteName:] did not succeed.
+
+        No new tests, since I have not been able to reproduce.
+
+        * UIProcess/Cocoa/PreferenceObserver.mm:
+        (-[WKPreferenceObserver init]):
+
 2020-03-16  Brent Fulgham  <[email protected]>
 
         Remove unused IPC messages from DrawingAreaProxy

Modified: trunk/Source/WebKit/UIProcess/Cocoa/PreferenceObserver.mm (258514 => 258515)


--- trunk/Source/WebKit/UIProcess/Cocoa/PreferenceObserver.mm	2020-03-16 19:57:45 UTC (rev 258514)
+++ trunk/Source/WebKit/UIProcess/Cocoa/PreferenceObserver.mm	2020-03-16 20:11:01 UTC (rev 258515)
@@ -203,6 +203,10 @@
 
     for (auto domain : domains) {
         auto userDefaults = adoptNS([[WKUserDefaults alloc] initWithSuiteName:domain]);
+        if (!userDefaults) {
+            WTFLogAlways("Could not init user defaults instance for domain %s", String(domain).utf8().data());
+            continue;
+        }
         userDefaults.get()->m_observer = self;
         // Start observing a dummy key in order to make the preference daemon become aware of our NSUserDefaults instance.
         // This is to make sure we receive KVO notifications. We cannot use normal KVO techniques here, since we are looking
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to