NullReferenceException when setting MSTS installation path
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Open Rails |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
Steps to reproduce:
I made a clean install with the 1.2 installer
It pops up the Options Content page, and when I chose the path of MSTS, press OK, this arises:
System.
at ORTS.OptionsFor
at System.
at System.
at System.
at System.
at System.
at System.
at System.
at System.
at System.
at System.
This happens with instable channel, and locally built SVN r3822 as well.
Looks like ORTS.OptionsFor
Changed in or: | |
milestone: | none → 1.4 |
I've got some time to further investigate the problem, and I created a patch fixing it too.
The bug occurred only when OR could not find the MSTS path in the registry, and there was no content folder added either. The datagrid is therefore empty, but the browse button is not disabled, its event handler tries to access the current selection in the datagrid upon selecting something, but it is null.
My solution is pretty straightforward, check for entries in the OptionsForm constructor and disable the browse button and name textfield if necessary. Also added a null check in the folder browser's event handler, just in case.