Browse Source

fix null pointer exception

master v1.0.1
Nicolas Massé 4 years ago
parent
commit
c421ca0e12
  1. 8
      main.go

8
main.go

@ -219,6 +219,12 @@ func computeRepositoriesToMigrate(gh GHRepositoryList, gt GTRepositoryList) GHRe
}
func migrate(ghRepo *github.Repository, gtClient *gitea.Client, gtUser *gitea.User) error {
// the description is an optional field
var description string = ""
if ghRepo.Description != nil {
description = *ghRepo.Description
}
migrationOptions := gitea.MigrateRepoOption{
CloneAddr: *ghRepo.CloneURL,
AuthUsername: *ghRepo.Owner.Login,
@ -227,7 +233,7 @@ func migrate(ghRepo *github.Repository, gtClient *gitea.Client, gtUser *gitea.Us
RepoName: *ghRepo.Name,
Mirror: true,
Private: *ghRepo.Private,
Description: *ghRepo.Description,
Description: description,
}
_, err := gtClient.MigrateRepo(migrationOptions)
return err

Loading…
Cancel
Save