Bug 225605 - Add null check in CachedResource::clearLoader
Summary: Add null check in CachedResource::clearLoader
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Alex Christensen
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2021-05-10 12:25 PDT by Alex Christensen
Modified: 2021-05-10 14:17 PDT (History)
5 users (show)

See Also:


Attachments
Patch (1.57 KB, patch)
2021-05-10 12:26 PDT, Alex Christensen
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alex Christensen 2021-05-10 12:25:10 PDT
Add null check in CachedResource::clearLoader
Comment 1 Alex Christensen 2021-05-10 12:26:03 PDT
Created attachment 428193 [details]
Patch
Comment 2 Alex Christensen 2021-05-10 12:26:06 PDT
<rdar://problem/69912354>
Comment 3 Geoffrey Garen 2021-05-10 12:46:59 PDT
Comment on attachment 428193 [details]
Patch

r=me

You can make this fewer lines of code if you keep it as ASSERT(m_loader).
Comment 4 Alex Christensen 2021-05-10 12:49:33 PDT
Comment on attachment 428193 [details]
Patch

I agree.  I have received the feedback many times in the past that the WebKit developers don't like having code that looks like this:
ASSERT(something);
if (something)
    somethingIsTrue();

But for some reason they are ok with this.  Maybe we should have another super-long style discussion on webkit-dev.
Comment 5 EWS 2021-05-10 14:17:18 PDT
Committed r277292 (237553@main): <https://commits.webkit.org/237553@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 428193 [details].