From 23a9e0503dc29d9cb630bdba50342ff70027f86a Mon Sep 17 00:00:00 2001 From: Chris Forbes Date: Mon, 19 Dec 2011 14:39:00 +1300 Subject: [PATCH] don't crash on missing voice phrases --- OpenRA.Game/Sound.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/OpenRA.Game/Sound.cs b/OpenRA.Game/Sound.cs index bba92f2646..f742603d73 100644 --- a/OpenRA.Game/Sound.cs +++ b/OpenRA.Game/Sound.cs @@ -238,6 +238,9 @@ namespace OpenRA var vi = Rules.Voices[mi.Voice.ToLowerInvariant()]; + if (!vi.Pools.Value.ContainsKey(phrase)) + return false; + var clip = vi.Pools.Value[phrase].GetNext(); if (clip == null) return false;