diff --git a/Userland/Libraries/LibJS/Runtime/ArrayPrototype.cpp b/Userland/Libraries/LibJS/Runtime/ArrayPrototype.cpp index 8dbc154a38..91f61a1d7c 100644 --- a/Userland/Libraries/LibJS/Runtime/ArrayPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/ArrayPrototype.cpp @@ -1486,7 +1486,7 @@ JS_DEFINE_NATIVE_FUNCTION(ArrayPrototype::at) } if (index.has_overflow() || index.value() >= length) return js_undefined(); - return this_object->get(index.value()); + return this_object->get(index.value()).value_or(js_undefined()); } }