aboutsummaryrefslogtreecommitdiffstats
path: root/modules/migrations/gitea.go
diff options
context:
space:
mode:
Diffstat (limited to 'modules/migrations/gitea.go')
-rw-r--r--modules/migrations/gitea.go18
1 files changed, 12 insertions, 6 deletions
diff --git a/modules/migrations/gitea.go b/modules/migrations/gitea.go
index a087cafe9d..8da1bd4683 100644
--- a/modules/migrations/gitea.go
+++ b/modules/migrations/gitea.go
@@ -393,13 +393,16 @@ func (g *GiteaLocalUploader) CreateIssues(issues ...*base.Issue) error {
iss = append(iss, &is)
}
- err := models.InsertIssues(iss...)
- if err != nil {
- return err
- }
- for _, is := range iss {
- g.issues.Store(is.Index, is.ID)
+ if len(iss) > 0 {
+ if err := models.InsertIssues(iss...); err != nil {
+ return err
+ }
+
+ for _, is := range iss {
+ g.issues.Store(is.Index, is.ID)
+ }
}
+
return nil
}
@@ -478,6 +481,9 @@ func (g *GiteaLocalUploader) CreateComments(comments ...*base.Comment) error {
cms = append(cms, &cm)
}
+ if len(cms) == 0 {
+ return nil
+ }
return models.InsertIssueComments(cms)
}