Failed to call hook 'OnUserGroupAdded' on plugin 'VehicleStorage v3.2.1'Fixed

Noticed this in my log, thought I'd pass it on.

Failed to call hook 'OnUserGroupAdded' on plugin 'VehicleStorage v3.2.1' (NullReferenceException: Object reference not set to an instance of an object)
  at Oxide.Plugins.VehicleStorage+ModularCarStorageModuleConfig.GetOwnerId (BaseEntity entity) [0x0001d] in <6b40887609a24a24adacec12caa49bdb>:0 
  at Oxide.Plugins.VehicleStorage.HandlePermissionChanged (System.String userIdString) [0x00044] in <6b40887609a24a24adacec12caa49bdb>:0 
  at Oxide.Plugins.VehicleStorage.OnUserGroupAdded (System.String userId, System.String groupName) [0x0002b] in <6b40887609a24a24adacec12caa49bdb>:0 
  at Oxide.Plugins.VehicleStorage.DirectCallHook (System.String name, System.Object& ret, System.Object[] args) [0x00390] in <6b40887609a24a24adacec12caa49bdb>: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 ​

Thanks for reporting.

I've looked at the code, and I see some edge cases where this appears to be possible. Do you have any plugins which attach modular car modules in places they aren't normally supposed to be? For instance, a double decker car, or car modules on other vehicles. Could also be an issue where Copy Paste tried to paste a car.

I don't believe I do. I think the only plugins I have that do are yours.
Is there any code I might search for within plugins to determine if this attachment is taking place?

One approach would be to search plugins for all of the module prefabs.

0 - assets/content/vehicles/modularcar/module_entities/_base_car_module.prefab
1 - assets/content/vehicles/modularcar/module_entities/1module_cockpit.prefab
2 - assets/content/vehicles/modularcar/module_entities/1module_cockpit_armored.prefab
3 - assets/content/vehicles/modularcar/module_entities/1module_cockpit_with_engine.prefab
4 - assets/content/vehicles/modularcar/module_entities/1module_engine.prefab
5 - assets/content/vehicles/modularcar/module_entities/1module_flatbed.prefab
6 - assets/content/vehicles/modularcar/module_entities/1module_passengers_armored.prefab
7 - assets/content/vehicles/modularcar/module_entities/1module_rear_seats.prefab
8 - assets/content/vehicles/modularcar/module_entities/1module_storage.prefab
9 - assets/content/vehicles/modularcar/module_entities/1module_taxi.prefab
10 - assets/content/vehicles/modularcar/module_entities/2module_camper.prefab
11 - assets/content/vehicles/modularcar/module_entities/2module_flatbed.prefab
12 - assets/content/vehicles/modularcar/module_entities/2module_fuel_tank.prefab
13 - assets/content/vehicles/modularcar/module_entities/2module_passengers.prefab

 

I've released a new version of the plugin which should prevent the errors, but it's possible that this will simply hide the underlying problem. Since we don't know which specific circumstances cause the issue, it's possible that a feature of the plugin might not be working, but it's difficult to tell without being able to reproduce the error.

I searched for 'assets/content/vehicles/modularcar/module_entities' but didn't find anything. I guess we'll see if any issues arise. Thanks for quick response as always.

Locked automatically