mirror of
https://github.com/gogs/gogs.git
synced 2026-05-06 18:26:58 +02:00
autofix: fix check for empty string (#6804)
Co-authored-by: deepsource-autofix[bot] <62050782+deepsource-autofix[bot]@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
65526f84e1
commit
deec3516d5
@@ -12,7 +12,7 @@ import (
|
||||
)
|
||||
|
||||
func Markdown(c *context.APIContext, form api.MarkdownOption) {
|
||||
if len(form.Text) == 0 {
|
||||
if form.Text == "" {
|
||||
_, _ = c.Write([]byte(""))
|
||||
return
|
||||
}
|
||||
|
||||
@@ -142,7 +142,7 @@ func EditIssue(c *context.APIContext, form api.EditIssueOption) {
|
||||
|
||||
if c.Repo.IsWriter() && form.Assignee != nil &&
|
||||
(issue.Assignee == nil || issue.Assignee.LowerName != strings.ToLower(*form.Assignee)) {
|
||||
if len(*form.Assignee) == 0 {
|
||||
if *form.Assignee == "" {
|
||||
issue.AssigneeID = 0
|
||||
} else {
|
||||
assignee, err := db.GetUserByName(*form.Assignee)
|
||||
|
||||
Reference in New Issue
Block a user