From 95afb87343910ed6881e3d0cecc0d9e76f6719b4 Mon Sep 17 00:00:00 2001 From: pkanavos Date: Mon, 2 Jul 2012 11:43:39 +0300 Subject: [PATCH] Fix for possible NULL S --- trunk/Pithos.Core/Agents/PollAgent.cs | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/trunk/Pithos.Core/Agents/PollAgent.cs b/trunk/Pithos.Core/Agents/PollAgent.cs index 466c997..0eff9a4 100644 --- a/trunk/Pithos.Core/Agents/PollAgent.cs +++ b/trunk/Pithos.Core/Agents/PollAgent.cs @@ -603,9 +603,19 @@ namespace Pithos.Core.Agents { // (Identical Changes) Result: L = S //doNothing() - //Detect server moves - var targetPath = MoveForServerMove(accountInfo, tuple); - StatusKeeper.StoreInfo(targetPath, tuple.ObjectInfo); + + //Don't update anything for nonexistend server files + if (tuple.S != null) + { + //Detect server moves + var targetPath = MoveForServerMove(accountInfo, tuple); + StatusKeeper.StoreInfo(targetPath, tuple.ObjectInfo); + } + else + { + //Log the null tuple for investigation + Log.WarnFormat("Null tuple detected Path:[{0}], State:[{1}],LocalFile:[{2}]",tuple.FilePath,tuple.FileState,tuple.FileInfo); + } } else { @@ -646,7 +656,8 @@ namespace Pithos.Core.Agents var serverPath = Path.Combine(accountInfo.AccountPath, relativePath); //Compare Case Insensitive - if (String.Equals(tuple.FilePath ,serverPath,StringComparison.InvariantCultureIgnoreCase)) return serverPath; + if (String.Equals(tuple.FilePath ,serverPath,StringComparison.InvariantCultureIgnoreCase)) + return serverPath; if (tuple.FileInfo.Exists) { -- 1.7.10.4