mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 09:37:34 +00: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())));
|
string = format_double(metadata.format.characters(), TRY(value.to_double(cell.sheet().global_object())));
|
||||||
|
|
||||||
if (metadata.length >= 0)
|
if (metadata.length >= 0)
|
||||||
return string.substring(0, metadata.length);
|
return string.substring(0, min(string.length(), metadata.length));
|
||||||
|
|
||||||
return string;
|
return string;
|
||||||
});
|
});
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue