diff options
author | Idan Horowitz <idan.horowitz@gmail.com> | 2021-10-17 23:57:37 +0300 |
---|---|---|
committer | Idan Horowitz <idan.horowitz@gmail.com> | 2021-10-18 08:01:38 +0300 |
commit | aad12b050bc2f34e367ef95ad89728a0bd4f662e (patch) | |
tree | 81da361ab91e5d0bfbe4706dccb1759fe2bdb930 /Userland/Applications/Spreadsheet | |
parent | 750da61c0fee4990a44b6113169d0740990596b3 (diff) | |
download | serenity-aad12b050bc2f34e367ef95ad89728a0bd4f662e.zip |
LibJS: Convert to_length() to ThrowCompletionOr
Diffstat (limited to 'Userland/Applications/Spreadsheet')
-rw-r--r-- | Userland/Applications/Spreadsheet/JSIntegration.cpp | 4 |
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()); } |