summaryrefslogtreecommitdiff
path: root/src/newgrf_industries.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/newgrf_industries.cpp')
-rw-r--r--src/newgrf_industries.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/newgrf_industries.cpp b/src/newgrf_industries.cpp
index 4b54a2e93..46cd2c105 100644
--- a/src/newgrf_industries.cpp
+++ b/src/newgrf_industries.cpp
@@ -214,8 +214,8 @@ uint32 IndustryGetVariable(const ResolverObject *object, byte variable, byte par
byte colours;
bool is_ai = false;
- if (Company::IsValidID(industry->founder)) {
- const Company *c = Company::Get(industry->founder);
+ const Company *c = Company::GetIfValid(industry->founder);
+ if (c != NULL) {
const Livery *l = &c->livery[LS_DEFAULT];
is_ai = c->is_ai;