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
commit 7047a5ca59
Notes: sideshowbarker 2024-07-17 16:23:55 +09:00

View file

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