don't crash on empty orders

This commit is contained in:
Matthias Mailänder
2013-12-28 16:50:03 +01:00
parent d87810a29c
commit 7d19e25627
2 changed files with 11 additions and 2 deletions

View File

@@ -158,7 +158,12 @@ namespace OpenRA
// Find an actor with a phrase to say
foreach (var o in orders)
{
if (o.Subject.Destroyed) continue;
if (o == null)
continue;
if (o.Subject.Destroyed)
continue;
foreach (var v in o.Subject.TraitsImplementing<IOrderVoice>())
if (Sound.PlayVoice(v.VoicePhraseForOrder(o.Subject, o),
o.Subject, o.Subject.Owner.Country.Race))