NullReferenceException at UnloadFixed

Just starting new thread as requested

Using Vehicle License 

Storage doesnt reappear  after restart but  tail light does

it throws the unload error  on unload and reload 

13:49 [Error] Failed to call hook 'Unload' on plugin 'MiniCopterOptions v2.0.8' (NullReferenceException: Object reference not set to an instance of an object)
at Oxide.Plugins.MiniCopterOptions.Unload () [0x00086] in <752239132e574474a643aa6c8a4bd52a>:0

at Oxide.Plugins.MiniCopterOptions.DirectCallHook (System.String name, System.Object& ret, System.Object[] args) [0x00038] in <752239132e574474a643aa6c8a4bd52a>:0

at Oxide.Plugins.CSharpPlugin.InvokeMethod (Oxide.Core.Plugins.HookMethod method, System.Object[] args) [0x00079] in <31122a27a2414cd799150f8677cf39d4>:0

at Oxide.Core.Plugins.CSPlugin.OnCallHook (System.String name, System.Object[] args) [0x000d8] in <0fbce81d88d64454b3e7abb24df7026b>:0

at Oxide.Core.Plugins.Plugin.CallHook (System.String hook, System.Object[] args) [0x00060] in <0fbce81d88d64454b3e7abb24df7026b>:0

I checked start logs  there are no errors

so im setting up a copy instance to  play with  mods  and see  what happens , so my  host doesnt get nutty  restarting every  5 mins lol

I doubt this is related to Vehicle License specifically.

  1. Can you test if this issue also happens when you spawn a minicopter directly via the console with spawn minicopter.entity?
  2. After reloading the plugin like you did above, then spawning a new mini, does it have the storage then, or does the storage yet again only appear if you re-reload MiniCopterOptions?
  3. Does the error also occur every time you reload the plugin?

so on the copied instance it works fine theres no error  cant get it to  repeat what goes on the hosted server. 

Its getting to prime time here so ill have to try restarts  after players have  finished for the day 😄 

Not saying  it will be busy  jsut ya know how they get if the server is down when they want to play lol

Failed to call hook 'Unload' on plugin 'MiniCopterOptions v2.0.9' (NullReferenceException: Object reference not set to an instance of an object)

at Oxide.Plugins.MiniCopterOptions.Unload () [0x00086] in <664f6a2d9da54292826bb428eafb4255>:0

at Oxide.Plugins.MiniCopterOptions.DirectCallHook (System.String name, System.Object& ret, System.Object[] args) [0x00038] in <664f6a2d9da54292826bb428eafb4255>:0

at Oxide.Plugins.CSharpPlugin.InvokeMethod (Oxide.Core.Plugins.HookMethod method, System.Object[] args) [0x00079] in <60c318df79ed41688ea59335e48d61ad>:0

at Oxide.Core.Plugins.CSPlugin.OnCallHook (System.String name, System.Object[] args) [0x000d8] in <9882f28dc2204b4dba514a9ad18f5042>:0

at Oxide.Core.Plugins.Plugin.CallHook (System.String hook, System.Object[] args) [0x00060] in <9882f28dc2204b4dba514a9ad18f5042>:0

still getting this error every time the server restarts

Failed to call hook 'Unload' on plugin 'MiniCopterOptions v2.0.9' (NullReferenceException: Object reference not set to an instance of an object)
at Oxide.Plugins.MiniCopterOptions.Unload () [0x00086] in <6fa240b64e094bda977823239fcdca9d>:0

at Oxide.Plugins.MiniCopterOptions.DirectCallHook (System.String name, System.Object& ret, System.Object[] args) [0x00038] in <6fa240b64e094bda977823239fcdca9d>:0

at Oxide.Plugins.CSharpPlugin.InvokeMethod (Oxide.Core.Plugins.HookMethod method, System.Object[] args) [0x00079] in <60c318df79ed41688ea59335e48d61ad>:0

at Oxide.Core.Plugins.CSPlugin.OnCallHook (System.String name, System.Object[] args) [0x000d8] in <9882f28dc2204b4dba514a9ad18f5042>:0

at Oxide.Core.Plugins.Plugin.CallHook (System.String hook, System.Object[] args) [0x00060] in <9882f28dc2204b4dba514a9ad18f5042>:0

I have the plugin and Oxide updated to the latest.  Occassionaly storage and search light will disappear from the mini forcing me to reload.  This happens every time I reload:

MiniCopterOptions was compiled successfully in 275ms 
(Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 39)
Failed to call hook 'Unload' on plugin 'MiniCopterOptions v2.0.9' (NullReferenceException: Object reference not set to an instance of an object)
at Oxide.Plugins.MiniCopterOptions.Unload () [0x00086] in <d18fc2de663b44f7b47508ebfca24322>:0

at Oxide.Plugins.MiniCopterOptions.DirectCallHook (System.String name, System.Object& ret, System.Object[] args) [0x00038] in <d18fc2de663b44f7b47508ebfca24322>:0

at Oxide.Plugins.CSharpPlugin.InvokeMethod (Oxide.Core.Plugins.HookMethod method, System.Object[] args) [0x00079] in <60c318df79ed41688ea59335e48d61ad>:0

at Oxide.Core.Plugins.CSPlugin.OnCallHook (System.String name, System.Object[] args) [0x000d8] in <12678b905a6d43c3a9cc366104306651>:0

at Oxide.Core.Plugins.Plugin.CallHook (System.String hook, System.Object[] args) [0x00060] in <12678b905a6d43c3a9cc366104306651>:0

(Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 39)
Unloaded plugin Mini-Copter Options v2.0.9 by Pho3niX90
(Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 39)
Fallback handler could not load library /home/container/RustDedicated_Data/Mono/data-0x5625dc030790.so
[Mini-Copter Options] Applying settings except storage modifications to existing MiniCopters.
(Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 39)
Loaded plugin Mini-Copter Options v2.0.9 by Pho3niX90

no one interested in taking a look at this

Failed to call hook 'Unload' on plugin 'MiniCopterOptions v2.0.9' (NullReferenceException: Object reference not set to an instance of an object)

at Oxide.Plugins.MiniCopterOptions.Unload () [0x00086] in <d51648a69eef47549862af1139abfb98>:0

at Oxide.Plugins.MiniCopterOptions.DirectCallHook (System.String name, System.Object& ret, System.Object[] args) [0x00038] in <d51648a69eef47549862af1139abfb98>:0

at Oxide.Plugins.CSharpPlugin.InvokeMethod (Oxide.Core.Plugins.HookMethod method, System.Object[] args) [0x00079] in <60c318df79ed41688ea59335e48d61ad>:0

at Oxide.Core.Plugins.CSPlugin.OnCallHook (System.String name, System.Object[] args) [0x000d8] in <dfcb48ea05694263bbc08e62a39c274c>:0

at Oxide.Core.Plugins.Plugin.CallHook (System.String hook, System.Object[] args) [0x00060] in <dfcb48ea05694263bbc08e62a39c274c>:0

Apologies for the delay on this. I've been the one fixing this plugin in the past year, but I actually don't even use or like this plugin, so I mostly ignore it.

I inspected the code where this error happens, and I do not see any reason that it would happen, unless you are also experiencing an error when it loads.

  • Do you see any errors when the plugin loads?
  • Can you reproduce this issue every time you unload the plugin?
  • Do you have the configuration set to add the blue light on the back of the mini? If so, try disabling that and see if you still see the error.
  • Do your players notice any problems, or does this error seem harmless?
  • Do you see any errors when the plugin loads? no, only when the server shuts down or is restarting
  •  
  • Can you reproduce this issue every time you unload the plugin? i don't o.unload the program only when the server is restarting it happens.
  •  
  • Do you have the configuration set to add the blue light on the back of the mini? If so, try disabling that and see if you still see the error. i do will try. however once the server has restarted the plugin stops working the only way to get the plugin to rework is o. reload ......
  • Do your players notice any problems, or does this error seem harmless? the program no longer works after the system has restarted unless you o reload it ...

I can't reproduce either issue. Can you post your config?

Do you have the configuration set to add the blue light on the back of the mini?

I set this option to false in the config and it appears to unload now without the error.  ill monitor it over the next few days and auto restarts and keep you updated.  Thanks fella for your time ...

Yes, I tested with that option enabled.

Do you have any plugins which interact with the day/night cycle? Or perhaps a map that has modified that system somehow (not sure if that is even possible). That's the only thing I can see based on the code, since the blue light tries to follow the day/night cycle.

yes i use time of day     to decrease the length of the night

{
"DatePreset": {
"presetDay": 1,
"presetMonth": 1,
"presetYear": 2020,
"setPresetDate": false
},
"Settings": {
"authLevelCmds": 1,
"authLevelFreeze": 2,
"autoSkipDay": false,
"autoSkipNight": false,
"dayLength": 67,
"freezeDate": false,
"logAutoSkipConsole": true,
"nightLength": 3
},
"TimeFreeze": {
"freezeTimeOnload": false,
"timeToFreeze": 12.0
}
}

I found this code in Time Of Day that indicates something MiniCopterOptions might be missing.

if (TOD_Sky.Instance == null)
{
    componentSearchAttempts++;
    if (componentSearchAttempts < 10)
        timer.Once(1, OnServerInitialized);
    else
        PrintWarning("Could not find required component after 10 attempts. Plugin disabled");
    return;
}

This code is checking to see if the time system is ready. If it's not ready, the plugin will wait some more time for it to be ready. I'm not sure why that's necessary, but I presume it's there for a good reason. MiniCopterOptions is not doing this, which could definitely explain the NullReferenceException, so maybe MiniCopterOptions needs to be updated to be doing a similar check/wait.

Locked automatically