Просмотр исходного кода

tools: do not assume type != null

Daniele Bartolini 6 лет назад
Родитель
Сommit
ae37670ca4
1 измененных файлов с 2 добавлено и 1 удалено
  1. 2 1
      tools/level_editor/unit.vala

+ 2 - 1
tools/level_editor/unit.vala

@@ -211,7 +211,8 @@ public class Unit
 				if (!type_or_name.has_prefix("type"))
 					continue;
 
-				if ((string)db.get_property(unit_id, m) == component_type)
+				Value? type = db.get_property(unit_id, m);
+				if (type != null && (string)type == component_type)
 				{
 					ref_component_id = Guid.parse(id);
 					return true;