altmp / altv-js-module

JS module for alt:V Multiplayer. Powered by NodeJS & v8
MIT License
55 stars 35 forks source link

Properties of Resource class crash client and server #149

Closed xxshady closed 2 years ago

xxshady commented 2 years ago

Description of the problem

/

Reproduction steps

Two resources.

  1. Stop second resource from script or console server command
  2. Get second resource instance in first resource and try to read properties of it

resources.zip

Expected behaviour

/

Additional context

No response

Operating system

Windows 11

Version

10.0-dev21 or 10.0-rc2

Scope

shared

LeonMrBonnie commented 2 years ago

This is like the lowest of low priorities, because this is a scenario that will never ever happen for 99.9% of all servers. No one will stop a resource at runtime without restarting it and then access the Resource instance for it, this is a edge case that is so unlikely that it's just not worth for me to spend my time on

You can fix it yourself by using the resourceStart and resourceStop event callbacks getter available for V8Helpers::EventHandler, to mark a resource object as invalid and delete it or something.