summaryrefslogtreecommitdiff
path: root/src/ai/api/ai_sign.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/ai/api/ai_sign.cpp')
-rw-r--r--src/ai/api/ai_sign.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/ai/api/ai_sign.cpp b/src/ai/api/ai_sign.cpp
index 349bf42a1..63bce8fdf 100644
--- a/src/ai/api/ai_sign.cpp
+++ b/src/ai/api/ai_sign.cpp
@@ -20,7 +20,8 @@
/* static */ bool AISign::IsValidSign(SignID sign_id)
{
- return ::Sign::IsValidID(sign_id) && ::Sign::Get(sign_id)->owner == _current_company;
+ const Sign *si = ::Sign::GetIfValid(sign_id);
+ return si != NULL && si->owner == _current_company;
}
/* static */ bool AISign::SetName(SignID sign_id, const char *name)