How to fix Error: System.ArgumentNullException

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Minecarft
    Member
    • Jan 2022
    • 22

    #1

    How to fix Error: System.ArgumentNullException

    My game crashes after a specific location with this error:

    Error: System.ArgumentNullException: Value cannot be null.
    Parameter name: key
    at System.ThrowHelper.ThrowArgumentNullException(Exce ptionArgument argument)
    at System.Collections.Generic.Dictionary`2.FindEntry( TKey key)
    at Orts.Viewer3D.Popups.OSDLocations.PrepareFrame(Ren derFrame frame, ElapsedTime elapsedTime, Boolean updateFull) in C:\Jenkins\jobs\Open Rails Stable\workspace\Source\RunActivity\Viewer3D\Popup s\OSDLocations.cs:line 156
    at Orts.Viewer3D.Popups.WindowManager.PrepareFrame(Re nderFrame frame, ElapsedTime elapsedTime) in C:\Jenkins\jobs\Open Rails Stable\workspace\Source\RunActivity\Viewer3D\Popup s\WindowManager.cs:line 218
    at Orts.Viewer3D.Viewer.Update(RenderFrame frame, Single elapsedRealTime) in C:\Jenkins\jobs\Open Rails Stable\workspace\Source\RunActivity\Viewer3D\Viewe r.cs:line 860
    at Orts.Viewer3D.Processes.UpdaterProcess.Update() in C:\Jenkins\jobs\Open Rails Stable\workspace\Source\RunActivity\Viewer3D\Proce sses\UpdaterProcess.cs:line 132
    at Orts.Viewer3D.Processes.UpdaterProcess.DoUpdate() in C:\Jenkins\jobs\Open Rails Stable\workspace\Source\RunActivity\Viewer3D\Proce sses\UpdaterProcess.cs:line 108
    at Orts.Viewer3D.Processes.UpdaterProcess.UpdaterThre ad() in C:\Jenkins\jobs\Open Rails Stable\workspace\Source\RunActivity\Viewer3D\Proce sses\UpdaterProcess.cs:line 74
    at System.Threading.ExecutionContext.RunInternal(Exec utionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
    at System.Threading.ExecutionContext.Run(ExecutionCon text executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
    at System.Threading.ExecutionContext.Run(ExecutionCon text executionContext, ContextCallback callback, Object state)
    at System.Threading.ThreadHelper.ThreadStart()


    Information: Game.PopState()

    Can somebody help me fix this?
    Attached Files
  • derekmorton
    5500 Post Veteran



    • Nov 1999
    • 5699
    • Eltham, Victoria, Australia.
    • ORTS

    #2
    Always post the logfile.

    Comment

    • Minecarft
      Member
      • Jan 2022
      • 22

      #3
      Here.
      Attached Files

      Comment

      • derekmorton
        5500 Post Veteran



        • Nov 1999
        • 5699
        • Eltham, Victoria, Australia.
        • ORTS

        #4
        Looks like a bad world file.
        Have you spoken to the author?

        Comment

        • Minecarft
          Member
          • Jan 2022
          • 22

          #5
          No, I just downloaded this and this error only occurs in activity mode otherwise in explore mode it is fine.

          Comment

          • eric
            9500 Post Veteran and Administrator



            • Dec 2002
            • 9583
            • NS MP245.4 CNO&TP South District
            • English, SQL
            • General

            #6
            Every activity or just specific activities? Share the route and activity names.

            Sent from my SM-S911U using Tapatalk

            If you like what you see here at Trainsim.com, be it the discussions and knowledge in the forums, or items available in our library, I hope you'll consider a paid membership to help support keeping the site operating.... Thanks!

            Comment

            • Minecarft
              Member
              • Jan 2022
              • 22

              #7
              I only played two activities and both faced it

              Comment

              • kapitaen
                Senior Member

                • May 2010
                • 331
                • Germany
                • German + a little bit English
                • MSOR

                #8
                There are a lot of missing .sms, .wav .ace and .s files. I cannot say where the crash is coming from. But I would at least try to fix the following errors by getting the missing material or linking to existing files.
                Code:
                Warning: Skipped missing track sound TSDR_DEFAULT.sms
                Warning: File SOUND\TSDR_DEFAULT.sms missing from D:\Games\MSTS\ROUTES\TSDRV5
                Warning: System.IO.FileLoadException: D:\Games\MSTS\\sound\\crossing.sms ---> System.IO.FileNotFoundException: Could not find file 'D:\Games\MSTS\sound\crossing.sms'.
                Warning: Cannot find D:\Games\MSTS\trains\trainset\VG_UDAY_COACHES\ car sound file lhbwag.sms
                Warning: Cannot find D:\Games\MSTS\trains\trainset\VG_UDAY_COACHES\ car sound file BR642eng.sms
                Warning: Cannot find D:\Games\MSTS\trains\trainset\BGPro - Mega Pack\ car sound file ../../common.bgpro/Sounds/LHB/LHB_Eog.sms
                Warning: Cannot find D:\Games\MSTS\trains\trainset\BGPro - Mega Pack\ car sound file ..//BGPro - LHB AC Rajdhani Coaches/Sound/aswwag.sms
                ​
                Jan

                Comment

                • c44d9w
                  Member
                  • May 2010
                  • 58

                  #9
                  This seems like a world-file (ie. route) issue, possibly a location not having a name. The code that causes the exception:
                  Code:
                      foreach (var platform in worldFile.platforms)
                      {
                          if (State == DisplayState.Auto && Platforms != null && (!Platforms.ContainsKey(platform.ItemName) || !Platforms[platform.ItemName]))
                              continue;
                  The exception could be caused by platform.ItemName being NULL.

                  Comment

                  • Minecarft
                    Member
                    • Jan 2022
                    • 22

                    #10
                    so what should I do?

                    Comment

                    • derekmorton
                      5500 Post Veteran



                      • Nov 1999
                      • 5699
                      • Eltham, Victoria, Australia.
                      • ORTS

                      #11
                      As said before

                      Looks like a bad world file.
                      Have you spoken to the author?

                      Comment

                      • Minecarft
                        Member
                        • Jan 2022
                        • 22

                        #12
                        no

                        Comment

                        • derekmorton
                          5500 Post Veteran



                          • Nov 1999
                          • 5699
                          • Eltham, Victoria, Australia.
                          • ORTS

                          #13
                          He is the only one who can fix it.

                          Comment

                          Working...