summaryrefslogtreecommitdiffstats
path: root/models/wiki.go
diff options
context:
space:
mode:
authorBwko <bouwko@gmail.com>2016-12-03 22:31:54 +0100
committerBwko <bouwko@gmail.com>2016-12-03 22:31:54 +0100
commit0118b275b66d8aa54975410513fe14df2d1dc521 (patch)
tree68affff5358369a275f3a0a1a8c70a55ca6f6fe2 /models/wiki.go
parentc8f300b2cdc6f00ba1aeb98c51a534f18474b895 (diff)
downloadgitea-0118b275b66d8aa54975410513fe14df2d1dc521.tar.gz
gitea-0118b275b66d8aa54975410513fe14df2d1dc521.zip
Fix for #320
Suppress the error when we're removing a file that may not exist
Diffstat (limited to 'models/wiki.go')
-rw-r--r--models/wiki.go4
1 files changed, 1 insertions, 3 deletions
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)