From 4cc5825e597a00023616b3f2858fd948dc832ef2 Mon Sep 17 00:00:00 2001 From: Andrettin <6322423+Andrettin@users.noreply.github.com> Date: Tue, 1 Feb 2022 22:56:57 +0100 Subject: [PATCH] Fixed crash with the civilization group scripted condition if a unit had no civilization --- src/script/condition/civilization_group_condition.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/script/condition/civilization_group_condition.h b/src/script/condition/civilization_group_condition.h index c6d95498c..fba6c02f7 100644 --- a/src/script/condition/civilization_group_condition.h +++ b/src/script/condition/civilization_group_condition.h @@ -42,6 +42,10 @@ class civilization_group_condition final : public condition virtual bool check(const civilization *civilization) const override { + if (civilization == nullptr) { + return false; + } + return civilization->is_part_of_group(this->group); }