Explorar o código

LibWeb: Restore protection against empty HTMLImageElement resources

This if-statement was erroneously dropped in commit 8ff8309.
Timothy Flynn %!s(int64=2) %!d(string=hai) anos
pai
achega
e129c8049b
Modificáronse 1 ficheiros con 2 adicións e 1 borrados
  1. 2 1
      Userland/Libraries/LibWeb/HTML/HTMLImageElement.cpp

+ 2 - 1
Userland/Libraries/LibWeb/HTML/HTMLImageElement.cpp

@@ -512,7 +512,8 @@ after_step_6:
                     handle_failed_fetch();
                     handle_failed_fetch();
                 };
                 };
 
 
-                response->body().value().fully_read(realm(), move(process_body), move(process_body_error), JS::NonnullGCPtr { realm().global_object() }).release_value_but_fixme_should_propagate_errors();
+                if (response->body().has_value())
+                    response->body().value().fully_read(realm(), move(process_body), move(process_body_error), JS::NonnullGCPtr { realm().global_object() }).release_value_but_fixme_should_propagate_errors();
             });
             });
         };
         };