Fix crash using picker tool on rail/road stations when no GRF classes defined

See: #575
This commit is contained in:
Jonathan G Rennison
2023-07-20 10:04:18 +01:00
parent 73b9028bcc
commit c8ca16e43d
2 changed files with 6 additions and 0 deletions

View File

@@ -1123,6 +1123,9 @@ private:
*/
void EnsureSelectedStationClassIsVisible()
{
/* No additional station types present */
if (this->vscroll == nullptr) return;
uint pos = 0;
for (auto station_class : this->station_classes) {
if (station_class == _railstation.station_class) break;

View File

@@ -1252,6 +1252,9 @@ private:
void EnsureSelectedClassIsVisible()
{
/* No additional road stop types present */
if (this->vscrollList == nullptr) return;
uint pos = 0;
for (auto rs_class : this->roadstop_classes) {
if (rs_class == _roadstop_gui_settings.roadstop_class) break;