mirror of
https://github.com/go-gitea/gitea.git
synced 2026-10-09 13:52:59 +02:00
Avoid 500 panic error when uploading invalid maven package file (#31014)
PackageDescriptor.Metadata might be nil (and maybe not only for maven). This is only a quick fix. The new `if` block is written intentionally to avoid unnecessary indenting to the existing code.
This commit is contained in:
1 parent
f48cc501c4
commit
de9bcd1d23
4 files changed
+20
-2
No files matched your search
@@ -1,4 +1,8 @@
|
||||
{{if eq .PackageDescriptor.Package.Type "maven"}}
|
||||
{{if and (eq .PackageDescriptor.Package.Type "maven") (not .PackageDescriptor.Metadata)}}
|
||||
<h4 class="ui top attached header">{{ctx.Locale.Tr "packages.installation"}}</h4>
|
||||
<div class="ui attached segment">{{ctx.Locale.Tr "packages.no_metadata"}}</div>
|
||||
{{end}}
|
||||
{{if and (eq .PackageDescriptor.Package.Type "maven") .PackageDescriptor.Metadata}}
|
||||
<h4 class="ui top attached header">{{ctx.Locale.Tr "packages.installation"}}</h4>
|
||||
<div class="ui attached segment">
|
||||
<div class="ui form">
|
||||
|
||||
Reference in new issue
Block a user