From 0118b275b66d8aa54975410513fe14df2d1dc521 Mon Sep 17 00:00:00 2001 From: Bwko Date: Sat, 3 Dec 2016 22:31:54 +0100 Subject: Fix for #320 Suppress the error when we're removing a file that may not exist --- models/wiki.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'models/wiki.go') diff --git a/models/wiki.go b/models/wiki.go index 890e62b0cd..89da4571db 100644 --- a/models/wiki.go +++ b/models/wiki.go @@ -125,9 +125,7 @@ func (repo *Repository) updateWikiPage(doer *User, oldTitle, title, content, mes // So we want to make sure the symlink is removed before write anything. // The new file we created will be in normal text format. - if err := os.Remove(filename); err != nil { - return fmt.Errorf("Fail to remove %s: %v", filename, err) - } + _ = os.Remove(filename) if err = ioutil.WriteFile(filename, []byte(content), 0666); err != nil { return fmt.Errorf("WriteFile: %v", err) -- cgit v1.2.3