diff --git a/shared/V8Helpers.cpp b/shared/V8Helpers.cpp index 3f7b96ae..135baf6c 100644 --- a/shared/V8Helpers.cpp +++ b/shared/V8Helpers.cpp @@ -361,7 +361,8 @@ enum class RawValueType : uint8_t ENTITY, VECTOR3, VECTOR2, - RGBA + RGBA, + INVALID }; extern V8Class v8Entity; @@ -373,6 +374,7 @@ static inline RawValueType GetValueType(v8::Local ctx, v8::LocalIsVector3(val)) return RawValueType::VECTOR3; if(resource->IsVector2(val)) return RawValueType::VECTOR2; if(resource->IsRGBA(val)) return RawValueType::RGBA; + if(val->IsSharedArrayBuffer() || val->IsFunction()) return RawValueType::INVALID; else return RawValueType::GENERIC; } @@ -385,6 +387,7 @@ alt::MValueByteArray V8Helpers::V8ToRawBytes(v8::Local val) std::vector bytes; RawValueType type = GetValueType(ctx, val); + if(type == RawValueType::INVALID) return alt::MValueByteArray(); v8::ValueSerializer serializer(isolate); serializer.WriteHeader();