• Guest, RaceDepartment is now on Discord!  Join Here

BTB Crash: Object reference not set to an instance of an object

Alex Kyriak

Jul 14, 2009
I was editing terrain, removing some areas, then BTB displayed this error message below and stopped working, but didn't crash out. I could choose to Continue or Quit. I didn't save after seeing the message. I couldn't use BTB properly. The error message kept popping up. I pressed Quit, BTB closed. Upon attempting loading the track that crashed, to see if i could edit the pre-crash file, it displays the same message and displays nothing.

BTB has been working perfectly up until now. I am using BTB on Vista 64 Home, nvidia 275gtx, 4gb ram.

I have the following XPacks in use :
Ennis Extra
Great Britain RBR
Haywood Club
Race Objects
Road Dark
Road Mid

I can't attach the zip file of the venue.bin as it's too big for the forum, so i can email it to you (Brendon? Shall I email direct?)

Many thanks,


************** Exception Text **************
System.NullReferenceException: Object reference not set to an instance of an object.
at BobsBits.BObjects.SetMaterialUsedFlags()
at BobsBits.Venue.SetMaterialUsedFlagsAndAssignIds()
at BobsBits.Venue.SaveToBinary(String Filename, Boolean ForUndo)
at BobsTrackBuilder.UndoList.Add(String Description)
at BobsTrackBuilder.Globals.AddUndo(String Description)
at BobsTrackBuilder.cntlSurfaceShape.cntlSurfaceShape_MouseUp(Object sender, MouseEventArgs e)
at System.Windows.Forms.Control.OnMouseUp(MouseEventArgs e)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
at System.Windows.Forms.ContainerControl.WndProc(Message& m)
at System.Windows.Forms.UserControl.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

************** Loaded Assemblies **************
-- not required

Brendon Pywell

Bob's Track Builder
Feb 26, 2009
This error can occur when you have manually removed files from your XPacks folder/zips.

If this is not the case then we need to go back to a version of your project before this error. Somehow the problem has been saved into your Venue and it's unrecoverable.

You can get a recent backup of the Venue.bin from C:\Program Files\BobsTrackBuilder\Temporary Files . Order the files in this folder by date and pick a recent one (probably not the last one) then rename it to Venue.bin. Replace your existing project's Venue.bin and start BTB again.

Then try to repeat the problem and replicate the error.

Alex Kyriak

Jul 14, 2009
Ok thanks, Brendon. Reverting to a previously saved version did the trick and I didn't lose too much. Think it might have been an Xpack I tried very briefly, as you suggest.

Wierdly though, I had the fence SObject from Great Britain RBR placed in quite a few areas of my track, and all the subobjects within it got replaced with random other objects. Ie; the fence pattern was replaced with a marshalls hut and the end post item replaced with a vehicle, both from Trackside_objects. Have gone round and corrected them all, just thought I'd mention it. Not sure if this is related to the crash problem.


Mar 23, 2009
Even I did not removed any file manually, this stupid error gave me the energy to switch for Autocad modeling.

Good luck for who stays, I'm a bit tired.