aboutsummaryrefslogtreecommitdiff
path: root/src/options.zig
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/options.zig11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/options.zig b/src/options.zig
index 26485eb70..48ef405a0 100644
--- a/src/options.zig
+++ b/src/options.zig
@@ -646,7 +646,7 @@ pub const Platform = enum {
};
};
-pub const Loader = enum {
+pub const Loader = enum(u8) {
jsx,
js,
ts,
@@ -2089,8 +2089,13 @@ pub const OutputFile = struct {
.buffer => |buffer| brk: {
var blob = bun.default_allocator.create(JSC.WebCore.Blob) catch unreachable;
blob.* = JSC.WebCore.Blob.init(@constCast(buffer.bytes), buffer.allocator, globalObject);
- blob.store.?.mime_type = this.loader.toMimeType();
- blob.content_type = blob.store.?.mime_type.value;
+ if (blob.store) |store| {
+ store.mime_type = this.loader.toMimeType();
+ blob.content_type = store.mime_type.value;
+ } else {
+ blob.content_type = this.loader.toMimeType().value;
+ }
+
blob.allocator = bun.default_allocator;
const blob_jsvalue = blob.toJS(globalObject);
blob_jsvalue.ensureStillAlive();