fix panic

Signed-off-by: kim (grufwub) <grufwub@gmail.com>
development
kim (grufwub) 4 years ago
parent 56e5eff136
commit 6502922a4f

@ -255,6 +255,9 @@ func FetchFile(client *Client, file *os.File, stat os.FileInfo, p *Path, newFile
// Get file read lock
cached.RLock()
// Get contents from file
content = cached.Content().(FileContent)
// Check for file freshness
if !cached.IsFresh() {
// Try upgrade file lock, else error out (have to remember to unlock!!)
@ -263,9 +266,6 @@ func FetchFile(client *Client, file *os.File, stat os.FileInfo, p *Path, newFile
return errors.NewError(MutexUpgradeErr)
}
// Get contents from file
content = cached.Content().(FileContent)
// Refresh file contents
err := content.Load(p, file)
if err != nil {

Loading…
Cancel
Save