1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 14:07:45 +00:00

LibJS: Allow JS::make_handle(T*) to be called with nullptr

Instead of asserting, just return an empty Handle.
This commit is contained in:
Andreas Kling 2022-03-30 19:29:36 +02:00
parent d98f12b928
commit 7047a5ca59

View file

@ -70,6 +70,8 @@ private:
template<class T> template<class T>
inline Handle<T> make_handle(T* cell) inline Handle<T> make_handle(T* cell)
{ {
if (!cell)
return Handle<T> {};
return Handle<T>::create(cell); return Handle<T>::create(cell);
} }