Skip to content

Commit

Permalink
fix(shared): Fix GetBaseObjectOrNull throwing when entity could not b…
Browse files Browse the repository at this point in the history
…e created
  • Loading branch information
xLuxy committed Aug 26, 2024
1 parent 4ad0910 commit b8d7fd8
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions shared/V8ResourceImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -185,9 +185,14 @@ void V8ResourceImpl::BindEntity(v8::Local<v8::Object> val, alt::IBaseObject* han

v8::Local<v8::Value> V8ResourceImpl::GetBaseObjectOrNull(alt::IBaseObject* handle)
{
if(handle == nullptr || handle->IsRemoved()) return v8::Null(isolate);
else
return GetOrCreateEntity(handle)->GetJSVal(isolate);
if(handle == nullptr || handle->IsRemoved())
return v8::Null(isolate);

V8Entity* entity = GetOrCreateEntity(handle);
if (entity)
return entity->GetJSVal(isolate);

return v8::Null(isolate);
}

v8::Local<v8::Value> V8ResourceImpl::CreateVector3(alt::Vector3f vec)
Expand Down

0 comments on commit b8d7fd8

Please sign in to comment.