1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 11:38:11 +00:00

LibWeb: Make factory method of FileAPI::Blob fallible

This commit is contained in:
Kenneth Myhra 2023-02-14 19:55:21 +01:00 committed by Linus Groh
parent bc02686ae9
commit 15917146d3
4 changed files with 5 additions and 5 deletions

View file

@ -109,7 +109,7 @@ WebIDL::ExceptionOr<JS::Value> package_data(JS::Realm& realm, ByteBuffer bytes,
// Return a Blob whose contents are bytes and type attribute is mimeType.
// NOTE: If extracting the mime type returns failure, other browsers set it to an empty string - not sure if that's spec'd.
auto mime_type_string = mime_type.has_value() ? mime_type->serialized() : DeprecatedString::empty();
return FileAPI::Blob::create(realm, move(bytes), move(mime_type_string));
return TRY(FileAPI::Blob::create(realm, move(bytes), move(mime_type_string)));
}
case PackageDataType::FormData:
// If mimeTypes essence is "multipart/form-data", then: