mirror of
https://github.com/oven-sh/bun
synced 2026-02-02 15:08:46 +00:00
Fix potential crash when printing summary of node_modules.jsb without any packages in it
Former-commit-id: 928957dffcb907f188f097b13f90901f74caab86
This commit is contained in:
@@ -335,7 +335,7 @@ pub const NodeModuleBundle = struct {
|
||||
}
|
||||
|
||||
pub fn printSummary(this: *const NodeModuleBundle) void {
|
||||
const last = this.bundle.packages.len - 1;
|
||||
const last = std.math.max(this.bundle.packages.len, 1) - 1;
|
||||
const indent = comptime " ";
|
||||
for (this.bundle.packages) |pkg, i| {
|
||||
const modules = this.bundle.modules[pkg.modules_offset .. pkg.modules_offset + pkg.modules_length];
|
||||
|
||||
Reference in New Issue
Block a user