fixes #3198 by catching the null references completely

This commit is contained in:
Matthias Mailänder
2013-05-04 11:00:49 +02:00
parent d4b95ff40e
commit 94d9238ff9

View File

@@ -68,10 +68,8 @@ namespace OpenRA.Mods.RA.Widgets
foreach (var power in powers)
{
var item = power.a.Value;
if (item == null)
{
if (item == null || item.Info == null || item.Info.Image == null)
continue;
}
var sprite = iconSprites[item.Info.Image];
var size = sprite.size / new float2(2, 2);
var location = new float2(RenderBounds.Location) + new float2(power.i * (int)size.Length, 0);