Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GUI Error: System.NullReferenceException: Object reference not set #563

Closed
originalfoo opened this issue Nov 22, 2019 · 5 comments · Fixed by #614
Closed

GUI Error: System.NullReferenceException: Object reference not set #563

originalfoo opened this issue Nov 22, 2019 · 5 comments · Fixed by #614
Labels
BUG Defect detected confirmed Represents confirmed issue or bug
Milestone

Comments

@originalfoo
Copy link
Member

originalfoo commented Nov 22, 2019

User BadGamer on TM:PE 11.0-alpha 9 reports these errors:

output_log.txt
tmpe.log.txt

Savegame

Notable errors from logs:

NullReferenceException: Object reference not set to an instance of an object
  at TrafficManager.UI.TrafficManagerTool.OnEnable () [0x00000] in <filename unknown>:0 
UnityEngine.GameObject:Internal_AddComponentWithType(Type)
UnityEngine.GameObject:AddComponent(Type)
UnityEngine.GameObject:AddComponent()
TrafficManager.UI.UIBase:GetTrafficManagerTool(Boolean)
TrafficManager.UI.UIBase:EnableTool()
TrafficManager.UI.UIBase:SetToolMode(TrafficManagerMode)
TrafficManager.UI.UIBase:Show()
TrafficManager.UI.UIBase:ToggleMainMenu()
TrafficManager.UI.UIMainMenuButton:OnClick(UIMouseEventParameter)
ColossalFramework.UI.UIComponent:OnClick(UIMouseEventParameter)
ColossalFramework.UI.MouseHandler:ProcessInput(IInputTranslator, Ray, UIComponent, Boolean)
ColossalFramework.UI.UIInput:ProcessMouseInput()
ColossalFramework.UI.UIInput:Update()

and

IOException: Sharing violation on path C:\Program Files (x86)\Steam\steamapps\common\Cities_Skylines\Cities_Data\TMPE.log
  at System.IO.FileStream..ctor (System.String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, Boolean anonymous, FileOptions options) [0x00000] in <filename unknown>:0 
  at System.IO.FileStream..ctor (System.String path, FileMode mode, FileAccess access, FileShare share) [0x00000] in <filename unknown>:0 
  at (wrapper remoting-invoke-with-check) System.IO.FileStream:.ctor (string,System.IO.FileMode,System.IO.FileAccess,System.IO.FileShare)
  at System.IO.StreamWriter..ctor (System.String path, Boolean append, System.Text.Encoding encoding, Int32 bufferSize) [0x00000] in <filename unknown>:0 
  at System.IO.StreamWriter..ctor (System.String path, Boolean append) [0x00000] in <filename unknown>:0 
  at (wrapper remoting-invoke-with-check) System.IO.StreamWriter:.ctor (string,bool)
  at System.IO.File.AppendText (System.String path) [0x00000] in <filename unknown>:0 
  at CSUtil.Commons.Log.LogToFile (System.String log, LogLevel level) [0x00000] in <filename unknown>:0 
  at CSUtil.Commons.Log.Error (System.String s) [0x00000] in <filename unknown>:0 
  at TrafficManager.UI.UIMainMenuButton.OnClick (ColossalFramework.UI.UIMouseEventParameter p) [0x00000] in <filename unknown>:0 
  at ColossalFramework.UI.UIComponent.OnClick (ColossalFramework.UI.UIMouseEventParameter p) [0x00000] in <filename unknown>:0 
  at ColossalFramework.UI.UIInput+MouseHandler.ProcessInput (IInputTranslator translator, Ray ray, ColossalFramework.UI.UIComponent component, Boolean retainFocusSetting) [0x00000] in <filename unknown>:0 
  at ColossalFramework.UI.UIInput.ProcessMouseInput () [0x00000] in <filename unknown>:0 
  at ColossalFramework.UI.UIInput.Update () [0x00000] in <filename unknown>:0 

Note: After getting errors, user did full reinstall of CSL and still gets these errors.

also, lots of these

NullReferenceException: Object reference not set to an instance of an object
  at TrafficManager.UI.TrafficManagerTool.SetToolMode (ToolMode mode) [0x00000] in <filename unknown>:0 
  at TrafficManager.UI.MainMenu.MenuToolModeButton.OnClickInternal (ColossalFramework.UI.UIMouseEventParameter p) [0x00000] in <filename unknown>:0 
  at TrafficManager.UI.MainMenu.MenuButton.OnClick (ColossalFramework.UI.UIMouseEventParameter p) [0x00000] in <filename unknown>:0 
  at ColossalFramework.UI.UIInput+MouseHandler.ProcessInput (IInputTranslator translator, Ray ray, ColossalFramework.UI.UIComponent component, Boolean retainFocusSetting) [0x00000] in <filename unknown>:0 
  at ColossalFramework.UI.UIInput.ProcessMouseInput () [0x00000] in <filename unknown>:0 
  at ColossalFramework.UI.UIInput.Update () [0x00000] in <filename unknown>:0 
@originalfoo originalfoo added BUG Defect detected triage Awaiting issue categorisation labels Nov 22, 2019
@originalfoo
Copy link
Member Author

User did full reinstall of game, and also ran disk checks, virus checks, etc.

Updated TMPE.log

I noticed two versions of LSM subbed; maybe LSM has similar issues to TM:PE when multiple subs? Asked user to unsub one LSM and try again.

There's this in the TMPE.log:

Info 416.2508960: ThreadingExtension.OnBeforeSimulationFrame: First frame detected. Detours checked. Result: 1 missing detours
Error 416.2517855: Traffic Manager: President Edition detected an incompatibility with another mod! You can continue playing but it's NOT recommended. Traffic Manager will not work as expected. See TMPE.log for technical details.
   at CSUtil.Commons.Log.LogToFile(System.String log, LogLevel level)
   at CSUtil.Commons.Log.Error(System.String s)
   at TrafficManager.ThreadingExtension.OnBeforeSimulationFrame()
   at ThreadingWrapper.OnBeforeSimulationFrame()
   at SimulationManager.SimulationStep()
   at SimulationManager.SimulationThread()

Info 416.2531120: The following methods were overriden by another mod:
	<Harmony> RoadBaseAI.SimulationStep with 2 parameters (RoadBaseAI, Assembly-CSharp, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null)

I have most of the same mods subbed, except these ones:

  • 812107110 Less Steam -- I've used this in the past with no issues
  • 898480258 Camera Positions Utility -- also used this in past with no issues
  • 427258853 Pedestrian Crossings -- never tried this
  • 1844440354 Klyte's Fine Road Anarchy 2 -- not tried this yet
  • 1844442251 Klyte's Fine Road Tool 2 -- not tried this yet
  • 1803209875 Trees' Respiration 1.0.1 -- this has known incompatibilities with TM:PE 10.x, but should be fine with 11.x
  • 812125426 Network Extensions 2 -- no longer use this, but it should be OK
  • 1393797695 Touch This! Tool 3 -- not used this
  • 1645781000 Elektrix's Road Tools -- used this in past without issue; Electrix would have notified us if there was a problem
  • 455403039 Unlimited Trees Mod -- not used this
  • 531738447 CSL Show More Limits -- outdated mod, but should not cause any issues
  • 1412844620 Realistic Walking Speed -- not tried this yet, but shouldn't be an issue
  • 1689984220 Klyte's Electric Roads Mod 1.2.3 -- known issues with TM:PE 10.x but should be fine with 11.x
  • 747836519 AssetIconsV2 -- old and probably broken mod
  • 1586774819 Other Rail Track Speed Increaser 1.1.0 -- tested with TM:PE 10.21 so should be ok
  • 1410003347 Additive Shader -- unlikely to cause any issues
  • 409776678 Demand Master -- I suspect this might cause issues, but never confirmed it
  • 934994075 Service Vehicle Selector 2 (r4.0.2) -- not used this (I used DSL3 instead)
  • 816260433 Metro Overhaul -- not tried this since recent v9 update
  • 463845891 No Pillars -- very old mod, but should be ok
  • 1440928803 Parallel Road Tool 1.3.0 -- pretty sure this isn't yet compatible with TM:PE 11.x
  • 928128676 Improved Public Transport 2 [r4.4.0] -- no longer use, but should be ok
  • 420500168 One-Way Street Arrows -- base game now shows one way arrows

@krzychu124
Copy link
Member

I will push fix for this

NullReferenceException: Object reference not set to an instance of an object
  at TrafficManager.UI.TrafficManagerTool.OnEnable () [0x00000] in <filename unknown>:0 

@originalfoo originalfoo added this to the 11.0 milestone Nov 23, 2019
@originalfoo originalfoo added confirmed Represents confirmed issue or bug and removed triage Awaiting issue categorisation labels Nov 23, 2019
@originalfoo originalfoo modified the milestones: 11.0, 11.1 Jan 24, 2020
@originalfoo
Copy link
Member Author

originalfoo commented Feb 6, 2020

Can this issue be closed @krzychu124 & @kianzarrin

Edit: If so, should it's milestone be reverted to v11.0

@krzychu124
Copy link
Member

Info 416.2531120: The following methods were overriden by another mod:
RoadBaseAI.SimulationStep with 2 parameters (RoadBaseAI, Assembly-CSharp, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null)

Caused by 1803209875 Trees' Respiration 1.0.1 - related with mod loading order, not much can be done, I think

@originalfoo originalfoo modified the milestones: 11.1, 11.0 Feb 6, 2020
@originalfoo
Copy link
Member Author

Yup, that was recently added to incompatible mods list again #614

originalfoo added a commit that referenced this issue Feb 6, 2020
Updated changelog and readme to reference it.
krzychu124 added a commit that referenced this issue Feb 6, 2020
originalfoo added a commit that referenced this issue Apr 11, 2020
The mod is now compatible thanks to update from @klyte45

Tagging:  #614, #611, #563, #484
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BUG Defect detected confirmed Represents confirmed issue or bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants