Skip to content

Crash when you start Traffic without a keybind and try to change it #14

Description

@pehala

Describe the problem

Traffic doesn´t work correctly if you have a missing keybind. The issue only appears when you start the game without the keybind (I used Lane Connector). It results in Traffic not working and a possible crash.

Steps to reproduce

  1. Remove keybind for Lane Connector
  2. Restart game
  3. Try to do a Lane Connector change (Should not work)
  4. Try to get into Traffic menu to reset the keybind (Should crash)

Log files

Player.log
Traffic.Mod.log

Savegame?

Should not be needed, I can supply one, if the reproducer fails

Screenshots?

Not Needed

Notes or questions?

Error when accessing lane connector tool when keybind for it is missing:

[UI] [ERROR]  Error in value binding 'Traffic.keybindings'
 System.ArgumentNullException: Value cannot be null.
Parameter name: source
  at System.Linq.Enumerable.Select[TSource,TResult] (System.Collections.Generic.IEnumerable`1[T] source, System.Func`2[T,TResult] selector) [0x0000d] in <a314714511a14f84b853c03efd8682b8>:0 
  at Game.Input.ProxyBinding.Write (Colossal.UI.Binding.IJsonWriter writer) [0x0003c] in <407a0a0b0b484732bd578acd1adf3d7c>:0 
  at Colossal.UI.Binding.JsonWriterExtensions.Write[T] (Colossal.UI.Binding.IJsonWriter writer, T value) [0x00000] in <35225c09a38f4619afbd43dd567a5bf0>:0 
  at Traffic.UISystems.ModUISystem+ModKeyBinds.Write (Colossal.UI.Binding.IJsonWriter writer) [0x0001c] in D:\Modding\Cities Skylines II\Release\Traffic\Code\UISystems\ModUISystem.cs:360 
  at Colossal.UI.Binding.ValueWriter`1[T].Write (Colossal.UI.Binding.IJsonWriter writer, T value) [0x00008] in <35225c09a38f4619afbd43dd567a5bf0>:0 
  at Colossal.UI.Binding.GetterValueBinding`1[T].TriggerUpdateImpl () [0x0001e] in <35225c09a38f4619afbd43dd567a5bf0>:0 
  at Colossal.UI.Binding.GetterValueBinding`1[T].TriggerUpdate () [0x00028] in <35225c09a38f4619afbd43dd567a5bf0>:0 
  at Colossal.UI.Binding.GetterValueBinding`1[T].OnSubscribe () [0x00006] in <35225c09a38f4619afbd43dd567a5bf0>:0 

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingknown issueIssue is known, not necessarily a bug,

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions