Bug 1235183. Part 2 - remove unnecessary null-checks. draft
authorJW Wang <jwwang@mozilla.com>
Thu, 23 Jun 2016 17:15:50 +0800
changeset 381738 025590e6e7bd80c147ceecb5b2563c86ba2b49d2
parent 381737 b304b2d4befcbb5d8bc50423d485db9f2e2106c4
child 381739 d883487f94862647ba4d4856d352125a848a31d5
push id21537
push userjwwang@mozilla.com
push dateTue, 28 Jun 2016 03:05:11 +0000
bugs1235183
milestone50.0a1
Bug 1235183. Part 2 - remove unnecessary null-checks. MozReview-Commit-ID: 6XZMrjw440L
dom/html/HTMLMediaElement.cpp
--- a/dom/html/HTMLMediaElement.cpp
+++ b/dom/html/HTMLMediaElement.cpp
@@ -378,23 +378,22 @@ HTMLMediaElement::MediaLoadListener::OnS
     element->GetCurrentSrc(src);
     const char16_t* params[] = { code.get(), src.get() };
     element->ReportLoadError("MediaLoadHttpError", params, ArrayLength(params));
     return NS_BINDING_ABORTED;
   }
 
   nsCOMPtr<nsIChannel> channel = do_QueryInterface(aRequest);
   if (channel &&
-      element &&
       NS_SUCCEEDED(rv = element->InitializeDecoderForChannel(channel, getter_AddRefs(mNextListener))) &&
       mNextListener) {
     rv = mNextListener->OnStartRequest(aRequest, aContext);
   } else {
     // If InitializeDecoderForChannel() returned an error, fire a network error.
-    if (NS_FAILED(rv) && !mNextListener && element) {
+    if (NS_FAILED(rv) && !mNextListener) {
       // Load failed, attempt to load the next candidate resource. If there
       // are none, this will trigger a MEDIA_ERR_SRC_NOT_SUPPORTED error.
       element->NotifyLoadError();
     }
     // If InitializeDecoderForChannel did not return a listener (but may
     // have otherwise succeeded), we abort the connection since we aren't
     // interested in keeping the channel alive ourselves.
     rv = NS_BINDING_ABORTED;