mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-12-23 20:17:03 +01:00
Backport #23822 by @KN4CK3R Fixes #23818 Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
This commit is contained in:
parent
fd0baf637d
commit
c34f7cdb1a
1 changed files with 7 additions and 1 deletions
|
@ -5,6 +5,7 @@ package packages
|
|||
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"fmt"
|
||||
"net/url"
|
||||
|
||||
|
@ -25,6 +26,7 @@ import (
|
|||
"code.gitea.io/gitea/modules/packages/pypi"
|
||||
"code.gitea.io/gitea/modules/packages/rubygems"
|
||||
"code.gitea.io/gitea/modules/packages/vagrant"
|
||||
"code.gitea.io/gitea/modules/util"
|
||||
|
||||
"github.com/hashicorp/go-version"
|
||||
)
|
||||
|
@ -98,8 +100,12 @@ func GetPackageDescriptor(ctx context.Context, pv *PackageVersion) (*PackageDesc
|
|||
}
|
||||
creator, err := user_model.GetUserByID(ctx, pv.CreatorID)
|
||||
if err != nil {
|
||||
if errors.Is(err, util.ErrNotExist) {
|
||||
creator = user_model.NewGhostUser()
|
||||
} else {
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
var semVer *version.Version
|
||||
if p.SemverCompatible {
|
||||
semVer, err = version.NewVersion(pv.Version)
|
||||
|
|
Loading…
Reference in a new issue