NullReferenceException at OnEntitySpawnedError
(I'm still trying to wrap my head around this stuff, so thank you for bearing with me).  Is it possible this is being caused by mod conflict?

Merged post

I think I figured it out!  It has to do with the radiation feature being visible or not.  If you leave it disabled, then no errors  ^_^
Here is my Error on Server startup on this plugin, Even  when i tried  to reinstall the plugin i get this error

Failed to call hook 'OnEntitySpawned' on plugin 'InfoPanel v0.9.9' (NullReferenceException: Object reference not set to an instance of an object)
at Oxide.Plugins.InfoPanel.OnEntitySpawned (BaseEntity Entity) [0x000cc] in <c5dcd32eea0b4af4a9fe85bbf1193ad9>:0

at Oxide.Plugins.InfoPanel.DirectCallHook (System.String name, System.Object& ret, System.Object[] args) [0x0063e] in <c5dcd32eea0b4af4a9fe85bbf1193ad9>:0

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

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

at Oxide.Core.Plugins.Plugin.CallHook (System.String hook, System.Object[] args) [0x00060] in <4452f821def6406d834e4149849fe7ea>:0
In response to Ruhadre ():
(I'm still trying to wrap my head around this stuff, so thank you for bearing with me).  Is it possi...
Still get that red message even i disabled everything about radiation.
Hello,

i had same message while server restarting. If I reloaded plugin after server fully running, i got no errors. So I added one variable and OnEntitySpawned can doing original function only after OnServerInitialized is called. Now no errors while restart :) I think problem is this function is called too early while server startsup.

My changes in InfoPanel.cs (i also write some original code around the new code - for easy diy change):

At begin of the cs file:

[Info("InfoPanel", "Ghosst / Nogrod / TeaPack", "1.0.0")]

#region DefaultConfigs
private static string DefaultFontColor = "1 1 1 1";
public bool startedup = false;
#endregion

In void OnServerInitialized():

if (ActiveCargoships.Count > 0)
{
CheckCargoship();
}
else
{
Cargoship.Refresh(storedData, PlayerPanels);
}
startedup = true;
}

And finally in OnEntitySpawned:

private void OnEntitySpawned(BaseEntity Entity)
{
if (startedup == false) return;
if (Entity == null) return;
Failed to call hook 'OnEntitySpawned' on plugin 'InfoPanel v0.9.9' (NullReferenc
eException: Object reference not set to an instance of an object)
at Oxide.Plugins.InfoPanel.OnEntitySpawned (BaseEntity Entity) [0x000cc] in <d
4dd2eb6095249d284ddddb84ed3536b>:0
at Oxide.Plugins.InfoPanel.DirectCallHook (System.String name, System.Object&
ret, System.Object[] args) [0x0063e] in <d4dd2eb6095249d284ddddb84ed3536b>:0
at Oxide.Plugins.CSharpPlugin.InvokeMethod (Oxide.Core.Plugins.HookMethod meth
od, System.Object[] args) [0x00079] in <9affce1cd15c4ec183941adef8db1722>:0
at Oxide.Core.Plugins.CSPlugin.OnCallHook (System.String name, System.Object[]
args) [0x000d8] in <4452f821def6406d834e4149849fe7ea>:0
at Oxide.Core.Plugins.Plugin.CallHook (System.String hook, System.Object[] arg
s) [0x00060] in <4452f821def6406d834e4149849fe7ea>:0


Merged post

Unloaded it, reloaded it and it's seems to load in fine?

InfoPanel was compiled successfully in 2082ms
Unloaded plugin InfoPanel v0.9.9 by Ghosst / Nogrod
Calling 'OnServerInitialized' on 'InfoPanel v0.9.9' took 206ms
Loaded plugin InfoPanel v0.9.9 by Ghosst / Nogrod

Getting this as of this morning : 

(11:54:25) | Failed to call hook 'OnEntitySpawned' on plugin 'InfoPanel v0.9.9' (NullReferenceException: Object reference not set to an instance of an object)

at Oxide.Plugins.InfoPanel.OnEntitySpawned (BaseEntity Entity) [0x000cc] in <ea2e3bf2f82b4af09a677e80eec06913>:0

at Oxide.Plugins.InfoPanel.DirectCallHook (System.String name, System.Object& ret, System.Object[] args) [0x0063e] in <ea2e3bf2f82b4af09a677e80eec06913>:0

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

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

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

In response to TeaPack ():
Hello,

i had same message while server restarting. If I reloaded plugin after server full...
THANK YOU, now no more errors i just do it like you and got fixed :)

This happens after the server restarts. But the plugin itself works fine.


| Failed to call hook 'OnEntitySpawned' on plugin 'InfoPanel v0.9.9' (NullReferenceException: Object reference not set to an instance of an object)

at Oxide.Plugins.InfoPanel.OnEntitySpawned (BaseEntity Entity) [0x000cc] in <948cfc99ca2941c98cd88b111e7fee94>:0

at Oxide.Plugins.InfoPanel.DirectCallHook (System.String name, System.Object& ret, System.Object[] args) [0x0063e] in <948cfc99ca2941c98cd88b111e7fee94>:0

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

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

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

(12:01:22) | done.

I applied @TeaPack's fixes as above, works perfectly.
Got the same Error in console:

Failed to call hook 'OnEntitySpawned' on plugin 'InfoPanel v0.9.9' (KeyNotFoundException: The given key was not present in the dictionary.) at System.Collections.Generic.Dictionary`2[TKey,TValue].get_Item (TKey key) [0x0001e] in :0 
  at Oxide.Plugins.InfoPanel.OnEntitySpawned (BaseEntity Entity) [0x000b8] in <2f4a7879eec246c9aa78ce13550ac643>:0 
  at Oxide.Plugins.InfoPanel.DirectCallHook (System.String name, System.Object& ret, System.Object[] args) [0x0063e] in <2f4a7879eec246c9aa78ce13550ac643>:0 
  at Oxide.Plugins.CSharpPlugin.InvokeMethod (Oxide.Core.Plugins.HookMethod method, System.Object[] args) [0x00079] in <9affce1cd15c4ec183941adef8db1722>:0 
  at Oxide.Core.Plugins.CSPlugin.OnCallHook (System.String name, System.Object[] args) [0x000d8] in <4452f821def6406d834e4149849fe7ea>:0 
  at Oxide.Core.Plugins.Plugin.CallHook (System.String hook, System.Object[] args) [0x00060] in <4452f821def6406d834e4149849fe7ea>:0 ​


Getting Errors with the solution from tea. Can you post the running script?

Okay so Tea's solution is hard for me to follow.

It's only on server start but I hat to see RED in my console.
I get it that the plugin needs to WAIT and all, so is it possible to just officially update the plugin.
I really hate to run too many plugins with my own mods. I already run a modded guishop.cs to add the Misc category, and the button for it, as well as playerranks to send MySQL the TimePlayed data as TEXT instead of TIME to fix the invalid time format error.
So now it's 3 plugins that have needed official fixes that are quick and simple.
The Tea's solution is not good for me. Please, find a fix for this. My serveur bug when this errors in my console. Thanks.
Error to console.
recently did not change anything in the plugin. and today when the server is loaded:



Merged post

Manual reboot of the plugin does not give any errors

That is the way it has been ever since the cargo ship update. It only happens on server start and not again.
You gotta read old threads but it's something to the effect that the plugin loads too early.
Once the server is up and running, no errors of any kind on any event.

But I get it, and I am the type also that doesn't want to see ANY RED ERRORS on my servers.

I just don't look anymore when that plugin loads on startup.
In response to shturval ():
Error to console.
recently did not change anything in the plugin. and today when the server is...

open your InfoPanel.cs plugin with notpad++ and remove all and past this and no more errors.

Moderator edit: Please do not post random versions of plugins on the forums, thanks.