Jump to content

Failed to call hook 'OnServerInitialized' on plugin 'LaunchExtended v1.3.0'

Pending 1.3.0

rogder dodger
rogder dodger

Posted

 Failed to call hook 'OnServerInitialized' on plugin 'LaunchExtended v1.3.0' (NullReferenceException: Object reference not set to an instance of an object)
at Oxide.Plugins.LaunchExtended.<SetupMonument>b__68_0 (MonumentInfo monument) [0x00015] in <d9f705e24b714cbe9f140fe028f957fc>:0
at System.Collections.Generic.List`1[T].ForEach (System.Action`1[T] action) [0x0001e] in <f98723dd4586469db5213ec59da723ca>:0
at Oxide.Plugins.LaunchExtended.SetupMonument () [0x00005] in <d9f705e24b714cbe9f140fe028f957fc>:0
at Oxide.Plugins.LaunchExtended.OnServerInitialized () [0x0002f] in <d9f705e24b714cbe9f140fe028f957fc>:0
at Oxide.Plugins.LaunchExtended.DirectCallHook (System.String name, System.Object& ret, System.Object[] args) [0x0006a] in <d9f705e24b714cbe9f140fe028f957fc>: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

and 

Failed to call hook 'OnServerInitialized' on plugin 'LaunchExtended v1.3.0' (NullReferenceException: Object reference not set to an instance of an object)
at Oxide.Plugins.LaunchExtended.<SetupMonument>b__68_0 (MonumentInfo monument) [0x00015] in <d9f705e24b714cbe9f140fe028f957fc>:0
at System.Collections.Generic.List`1[T].ForEach (System.Action`1[T] action) [0x0001e] in <f98723dd4586469db5213ec59da723ca>:0
at Oxide.Plugins.LaunchExtended.SetupMonument () [0x00005] in <d9f705e24b714cbe9f140fe028f957fc>:0
at Oxide.Plugins.LaunchExtended.OnServerInitialized () [0x0002f] in <d9f705e24b714cbe9f140fe028f957fc>:0
at Oxide.Plugins.LaunchExtended.DirectCallHook (System.String name, System.Object& ret, System.Object[] args) [0x0006a] in <d9f705e24b714cbe9f140fe028f957fc>: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

Hey, plugin's crashing on init with a NullReferenceException inside the SetupMonument. Stack trace points to monument.displayPhrase.english.Contains("Launch Site")

As some monument types have a null 'displayPhrase' (or null english), so the null check on monument itself isn't enough.

Fix is straightforward though, if you swap line 468 to use null-conditional operators:

if (monument.displayPhrase?.english?.Contains("Launch Site") == true)

Also spotted a missing-braces issue on the if (launch == null) log line just below the return; was always executing unconditionally. Doesn't cause a crash since it's end of method anyway, but maybe worth tidying up a little:

if (launch == null) { Puts("LaunchSite not found"); return; }

Might be worth pushing these in the next update since the crash will hit anyone running a map that has monuments without display phrases set as i think many custom maps do. 

 

Great plugin though, thanks!

Rd 

 

 

 

image.png

NooBlet

Posted

thanks . ill make changes in morning going to bed now ,, been benching Wednesday , again

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
2.5m
Total downloads
Customers
11.1k
Customers served
Files Sold
159.4k
Total sales
Payments
3.4m
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.