fix: crash in Buffer.set_file_path
This commit is contained in:
parent
c88e2dd975
commit
1babf86ce4
1 changed files with 1 additions and 0 deletions
|
@ -1100,6 +1100,7 @@ pub fn get_meta(self: *Self) ?[]const u8 {
|
|||
}
|
||||
|
||||
pub fn set_file_path(self: *Self, file_path: []const u8) void {
|
||||
if (file_path.ptr == self.file_path_buf.items.ptr) return;
|
||||
self.file_path_buf.clearRetainingCapacity();
|
||||
self.file_path_buf.appendSlice(self.external_allocator, file_path) catch |e| switch (e) {
|
||||
error.OutOfMemory => @panic("OOM in Buffer.set_file_path"),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue