From 3754e791e5574ebadb04b5ccf24f545a0bec1c1a Mon Sep 17 00:00:00 2001 From: James Dunne Date: Fri, 29 Jun 2012 22:55:45 -0500 Subject: [PATCH] Fix for null ref exception after refinery is sold. --- OpenRA.Mods.RA/Harvester.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OpenRA.Mods.RA/Harvester.cs b/OpenRA.Mods.RA/Harvester.cs index 4514a1c9c8..f646fd7867 100644 --- a/OpenRA.Mods.RA/Harvester.cs +++ b/OpenRA.Mods.RA/Harvester.cs @@ -148,7 +148,7 @@ namespace OpenRA.Mods.RA { // Check that we're not in a critical location and being useless (refinery drop-off): var lastproc = LastLinkedProc ?? LinkedProc; - if (lastproc != null) + if (lastproc != null && !lastproc.Destroyed) { var deliveryLoc = lastproc.Location + lastproc.Trait().DeliverOffset; if (self.Location == deliveryLoc)