summaryrefslogtreecommitdiff
path: root/Userland/Applications/Spreadsheet
diff options
context:
space:
mode:
authorIdan Horowitz <idan.horowitz@gmail.com>2021-10-17 23:57:37 +0300
committerIdan Horowitz <idan.horowitz@gmail.com>2021-10-18 08:01:38 +0300
commitaad12b050bc2f34e367ef95ad89728a0bd4f662e (patch)
tree81da361ab91e5d0bfbe4706dccb1759fe2bdb930 /Userland/Applications/Spreadsheet
parent750da61c0fee4990a44b6113169d0740990596b3 (diff)
downloadserenity-aad12b050bc2f34e367ef95ad89728a0bd4f662e.zip
LibJS: Convert to_length() to ThrowCompletionOr
Diffstat (limited to 'Userland/Applications/Spreadsheet')
-rw-r--r--Userland/Applications/Spreadsheet/JSIntegration.cpp4
1 files changed, 1 insertions, 3 deletions
diff --git a/Userland/Applications/Spreadsheet/JSIntegration.cpp b/Userland/Applications/Spreadsheet/JSIntegration.cpp
index 578cb9b8b3..463973d8e9 100644
--- a/Userland/Applications/Spreadsheet/JSIntegration.cpp
+++ b/Userland/Applications/Spreadsheet/JSIntegration.cpp
@@ -425,9 +425,7 @@ JS_DEFINE_NATIVE_FUNCTION(WorkbookObject::sheet)
return JS::Value(&sheet.global_object());
}
} else {
- auto index = name_value.to_length(global_object);
- if (vm.exception())
- return {};
+ auto index = TRY_OR_DISCARD(name_value.to_length(global_object));
if (index < workbook.sheets().size())
return JS::Value(&workbook.sheets()[index].global_object());
}