Jump to content

NRE

Pending 2.2.1

MrLiquid
MrLiquid

Posted

Failed to call hook 'OnEntityTakeDamage' on plugin 'BossMonster v2.2.1' (NullReferenceException: Object reference not set to an instance of an object.)
  at Oxide.Plugins.BossMonster.OnEntityTakeDamage (ScientistNPC entity, HitInfo info) [0x00020] in <6d0ae9c698024ee89c03236815ca5321>:0 
  at Oxide.Plugins.BossMonster.DirectCallHook (System.String name, System.Object& ret, System.Object[] args) [0x009bb] in <6d0ae9c698024ee89c03236815ca5321>:0 
  at Oxide.Plugins.CSharpPlugin.InvokeMethod (Oxide.Core.Plugins.HookMethod method, System.Object[] args) [0x00079] in <42f9bedc659b4f4786eb778d3cd58968>:0 
  at Oxide.Core.Plugins.CSPlugin.OnCallHook (System.String name, System.Object[] args) [0x000de] in <15f61ddda771464d8246ebdce8ff4811>:0 
  at Oxide.Core.Plugins.Plugin.CallHook (System.String hook, System.Object[] args) [0x00060] in <15f61ddda771464d8246ebdce8ff4811>:0 
NullReferenceException: Object reference not set to an instance of an object

The likely cause was accessing entity.net.ID when entity.net was null. 

Unsure the cause, found this in server log and thought id report it

aimacak

Posted

Hello, thanks, and you are right.
Its already in roadmap, you can add this check:
 

        private object OnEntityTakeDamage(ScientistNPC entity, HitInfo info)
        {
            //if (entity == null || info == null) return null;
            if (entity == null || info == null || entity.net == null) return null;
            if (_controllers.ContainsKey(entity.net.ID.Value))
            {

 

MrLiquid

Posted

Many thanks for a prompt reply.

About Us

Codefling is the largest marketplace for plugins, maps, tools, and more, making it easy for customers to discover new content and for creators to monetize their work.

Downloads
3.1m
Total downloads
Customers
12.1k
Customers served
Files Sold
172.2k
Total sales
Payments
3.7m
Processed total
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.