mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 06:37:44 +00:00
Spreadsheet: Skip over "invalid" saved cell values
These can be generated by saving something that's not serialisable (e.g. functions), skip over them and let the load logic reevaluate them when needed.
This commit is contained in:
parent
b0b8d14a2c
commit
0d302516d5
1 changed files with 4 additions and 1 deletions
|
@ -416,7 +416,10 @@ RefPtr<Sheet> Sheet::from_json(const JsonObject& object, Workbook& workbook)
|
|||
case Cell::Formula: {
|
||||
auto& interpreter = sheet->interpreter();
|
||||
auto value_or_error = JS::call(interpreter.global_object(), parse_function, json, JS::js_string(interpreter.heap(), obj.get("value").as_string()));
|
||||
VERIFY(!value_or_error.is_error());
|
||||
if (value_or_error.is_error()) {
|
||||
warnln("Failed to load previous value for cell {}, leaving as undefined", position.to_cell_identifier(sheet));
|
||||
value_or_error = JS::js_undefined();
|
||||
}
|
||||
cell = make<Cell>(obj.get("source").to_string(), value_or_error.release_value(), position, *sheet);
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue