NullReferenceException at GetVanillaStackSizeError

Not a high priority issue.

Since upgrading to 4.1.1 I've noticed the following error in the server console when starting the server and SSC is within the plugin folder at startup:

[Stack Size Controller] Exception encountered during GetStackSize. Item: hat.wolf Ex:System.NullReferenceException: Object reference not set to an instance of an object
at Oxide.Plugins.StackSizeController.GetVanillaStackSize (ItemDefinition itemDefinition) [0x00000] in <9dd62c3a43cb4311a2581eb26200e35e>:0
at Oxide.Plugins.StackSizeController.GetStackSize (ItemDefinition itemDefinition) [0x00023] in <9dd62c3a43cb4311a2581eb26200e35e>:0
Failed to call hook 'SetAllStacksCommand' on plugin 'StackSizeController v4.1.1' (NullReferenceException: Object reference not set to an instance of an object)
at Oxide.Plugins.StackSizeController.GetVanillaStackSize (ItemDefinition itemDefinition) [0x00000] in <9dd62c3a43cb4311a2581eb26200e35e>:0
at Oxide.Plugins.StackSizeController.GetStackSize (ItemDefinition itemDefinition) [0x001b2] in <9dd62c3a43cb4311a2581eb26200e35e>:0
at Oxide.Plugins.StackSizeController.SetStackSizes () [0x00070] in <9dd62c3a43cb4311a2581eb26200e35e>:0
at Oxide.Plugins.StackSizeController.SetAllStacksCommand (Oxide.Core.Libraries.Covalence.IPlayer player, System.String command, System.String[] args) [0x00092] in <9dd62c3a43cb4311a2581eb26200e35e>:0
at Oxide.Plugins.StackSizeController.DirectCallHook (System.String name, System.Object& ret, System.Object[] args) [0x010ae] in <9dd62c3a43cb4311a2581eb26200e35e>: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
Calling 'SetAllStacksCommand' on 'StackSizeController v4.1.1' took 870ms
This doesn't appear when unloading/loading the plugin after the server has started.

The item referenced in the error is hat.wolf, but SSC still seems to be modifying the size properly (10x):
> stacksizecontroller.itemsearch hat.wolf
Unique Id Shortname Category Vanilla Stack Custom Stack
-1478212975 hat.wolf Attire 1 10

I can confirm I have a StackSizeController_vanilla-defaults.json in my Oxide data directory, and that this contains "hat.wolf": 1

No issues with access to GitHub from the host, but I've restarted a couple of times to test just now and I've only seen that error twice more out of four restarts.

I'm happy to close this off if you are, just wasn't sure if it required further investegation.

It might just be an order of operations kind of thing, so if it doesn't happen often, and only on 1 or 2 items it should be alright. Going to be kinda hard to track down I imagine.

Getting this error upong loading StackSizeController, although as far as I can tell, it's working:

[Stack Size Controller] Exception encountered during GetStackSize. Item: wood Ex:System.NullReferenceException: Object reference not set to an instance of an object
at Oxide.Plugins.StackSizeController.GetVanillaStackSize (ItemDefinition itemDefinition) [0x00000] in <7681de9f96a2472f8c0d8fae7291a25f>:0
at Oxide.Plugins.StackSizeController.GetStackSize (ItemDefinition itemDefinition) [0x00023] in <7681de9f96a2472f8c0d8fae7291a25f>:0
05/05/2022 19:18:44 | [Stack Size Controller] Exception encountered during GetStackSize. Item: can.tuna Ex:System.NullReferenceException: Object reference not set to an instance of an object
at Oxide.Plugins.StackSizeController.GetVanillaStackSize (ItemDefinition itemDefinition) [0x00000] in <7681de9f96a2472f8c0d8fae7291a25f>:0
at Oxide.Plugins.StackSizeController.GetStackSize (ItemDefinition itemDefinition) [0x00023] in <7681de9f96a2472f8c0d8fae7291a25f>:0

i keep getting errors..

[Stack Size Controller] Exception encountered during GetStackSize. Item: charcoal Ex:System.NullReferenceException: Object reference not set to an instance of an object
at Oxide.Plugins.StackSizeController.GetVanillaStackSize (ItemDefinition itemDefinition) [0x00000] in <f9f227f9ff874039b2872e3b605e1b41>:0
at Oxide.Plugins.StackSizeController.GetStackSize (ItemDefinition itemDefinition) [0x00023] in <f9f227f9ff874039b2872e3b605e1b41>:0

Failed to call hook 'OnMaxStackable' on plugin 'StackSizeController v4.1.1' (NullReferenceException: Object reference not set to an instance of an object)
at Oxide.Plugins.StackSizeController.GetVanillaStackSize (ItemDefinition itemDefinition) [0x00000] in <f9f227f9ff874039b2872e3b605e1b41>:0

at Oxide.Plugins.StackSizeController.GetStackSize (ItemDefinition itemDefinition) [0x001b2] in <f9f227f9ff874039b2872e3b605e1b41>:0

at Oxide.Plugins.StackSizeController.OnMaxStackable (Item item) [0x00000] in <f9f227f9ff874039b2872e3b605e1b41>:0

at Oxide.Plugins.StackSizeController.DirectCallHook (System.String name, System.Object& ret, System.Object[] args) [0x00efc] in <f9f227f9ff874039b2872e3b605e1b41>:0

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

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

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

after reloading it like 2-3 times the errors are gone and the plugin works fine

oh this post is already existing but has no attention