<html>
<head>
<base href="https://bugs.webkit.org/" />
</head>
<body>
<p>
<div>
<b><a class="bz_bug_link
bz_status_RESOLVED bz_closed"
title="RESOLVED FIXED - Add support for image previews"
href="https://bugs.webkit.org/show_bug.cgi?id=146350#c9">Comment # 9</a>
on <a class="bz_bug_link
bz_status_RESOLVED bz_closed"
title="RESOLVED FIXED - Add support for image previews"
href="https://bugs.webkit.org/show_bug.cgi?id=146350">bug 146350</a>
from <span class="vcard"><a class="email" href="mailto:mitz@webkit.org" title="mitz@webkit.org <mitz@webkit.org>"> <span class="fn">mitz@webkit.org</span></a>
</span></b>
<pre>Comment on <span class=""><a href="attachment.cgi?id=255661&action=diff" name="attach_255661" title="Patch">attachment 255661</a> <a href="attachment.cgi?id=255661&action=edit" title="Patch">[details]</a></span>
Patch
View in context: <a href="https://bugs.webkit.org/attachment.cgi?id=255661&action=review">https://bugs.webkit.org/attachment.cgi?id=255661&action=review</a>
<span class="quote">>> Source/WebKit2/UIProcess/WKImagePreviewViewController.mm:57
>> + CGSize screenSize = UIApplication.sharedApplication.delegate.window.bounds.size;
>
> -window is an optional method in the UIApplicationDelegate protocol. Invoking it without checking if the delegate responds to it first could lead to a crash.</span >
Also, -delegate itself may return nil. And also, we normally don’t use dot notation to invoke class methods, so this should begin [UIApplication sharedApplication]. It’s also misleading to call something that is the size of a window screenSize. If we want the size of a screen we can use UIScreen API to get it.</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are the assignee for the bug.</li>
</ul>
</body>
</html>