From b74790187af78e11c1d145febd52a2dceb00a3f9 Mon Sep 17 00:00:00 2001 From: Jonathan G Rennison Date: Sun, 14 Feb 2016 03:04:53 +0000 Subject: [PATCH] Fix tbtr refit button crashing if new template window is empty. --- src/tbtr_template_gui_create.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/tbtr_template_gui_create.cpp b/src/tbtr_template_gui_create.cpp index 741b840716..79f8a808af 100644 --- a/src/tbtr_template_gui_create.cpp +++ b/src/tbtr_template_gui_create.cpp @@ -244,7 +244,9 @@ public: break; } case TCW_REFIT: { - ShowVehicleRefitWindow(virtual_train, INVALID_VEH_ORDER_ID, this, false, true); + if (virtual_train != NULL) { + ShowVehicleRefitWindow(virtual_train, INVALID_VEH_ORDER_ID, this, false, true); + } break; } }