diff options
author | Joey Hess <joey@kitenet.net> | 2013-03-11 13:52:06 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2013-03-11 13:55:36 -0400 |
commit | 893860527ee8044cf990abaf03bf0405ff1ddd53 (patch) | |
tree | 7fca45b576b5913d2e8556950ccef844dd32a92e /Assistant/Threads/Committer.hs | |
parent | 71cd744329491c7480bbf168c5f4630037d30688 (diff) |
fix changeFile to not be partial
That led to runtime crashes, without even a warning from -Wall. Yipes!
Diffstat (limited to 'Assistant/Threads/Committer.hs')
-rw-r--r-- | Assistant/Threads/Committer.hs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Assistant/Threads/Committer.hs b/Assistant/Threads/Committer.hs index 5be190c4a..e77c55dfd 100644 --- a/Assistant/Threads/Committer.hs +++ b/Assistant/Threads/Committer.hs @@ -390,7 +390,7 @@ safeToAdd delayadd pending inprocess = do - transfer scan does the same thing then. -} checkChangeContent :: Change -> Assistant () -checkChangeContent (Change { changeInfo = i , changeFile = f }) = +checkChangeContent change@(Change { changeInfo = i }) = case changeInfoKey i of Nothing -> noop Just k -> whenM (scanComplete <$> getDaemonStatus) $ do @@ -399,5 +399,6 @@ checkChangeContent (Change { changeInfo = i , changeFile = f }) = then queueTransfers "new file created" Next k (Just f) Upload else queueTransfers "new or renamed file wanted" Next k (Just f) Download handleDrops "file renamed" present k (Just f) Nothing + where + f = changeFile change checkChangeContent _ = noop - |