mirror of
https://github.com/SerenityOS/serenity.git
synced 2025-01-24 10:22:05 -05:00
Spreadsheet: Fix overridden max length related crash
NumericCell::display() attempted to take a substring of cell contents according to the "Override max length" parameter, but it did not account for the actual string length.
This commit is contained in:
parent
ce9f355b12
commit
67d10a50ee
1 changed files with 1 additions and 1 deletions
|
@ -28,7 +28,7 @@ JS::ThrowCompletionOr<String> NumericCell::display(Cell& cell, const CellTypeMet
|
|||
string = format_double(metadata.format.characters(), TRY(value.to_double(cell.sheet().global_object())));
|
||||
|
||||
if (metadata.length >= 0)
|
||||
return string.substring(0, metadata.length);
|
||||
return string.substring(0, min(string.length(), metadata.length));
|
||||
|
||||
return string;
|
||||
});
|
||||
|
|
Loading…
Add table
Reference in a new issue