ImaNewb

Member
I just started up the latest ServUO and get this message in the console after save and restart. I get this error after a save even if it is 100% stock.
Code:
[Persistence]: System.NullReferenceException: Object reference not set to an instance of an object.
   at Server.Engines.Points.PointsSystem.<OnLoad>b__14(GenericReader reader)
   at Server.Persistence.Deserialize(FileInfo file, Action`1 deserializer, Boolean ensure) in c:\Users\Admin\Desktop\ServUO-master\Server\Persistence\Persistence.cs:line 103
 
I can reproduce this behavior too, but only with "older" world saves.

Starting completely new, works.
 
Last edited:
Strange, I can compile in VS2015 or by batch file completely stock and get this after the first save. No old saves or anything just the initial save after admin account setup.
 
It's probably because whatever code in that system [Server.Engines.Points.PointsSystem] is used to Deserialize the data is also responsible for setting the initial values of some properties and settings.

If the file doesn't exist on world load, that code won't run, therefore some of the data that is supposed to be initialized doesn't get initialized.

This can usually be fixed by assign non-null default values to the uninitialized properties when the system is first access - a static constructor for static context, or in the object constructor for instance context.
 
So If I just comment out the write to console line in the persistence.cs and recompile so It doesn't show, I should be fine?
Code:
catch (Exception e)
                {
                    /* Console.WriteLine("[Persistence]: {0}", e); */
                }

Edit: Actually it seems this is not needed after [createworld is used. I don't get that error at all after everything is spawned and saved. :D
 
Last edited:

Active Shards

Donations

Total amount
$0.00
Goal
$1,000.00
Back