Skip to content

Commit

Permalink
nil check over reflect against empty struct for update repo
Browse files Browse the repository at this point in the history
  • Loading branch information
ecrupper committed Dec 11, 2023
1 parent a20781e commit 4c8ed98
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions api/repo/update.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import (
"encoding/base64"
"fmt"
"net/http"
"reflect"
"strings"

"github.com/gin-gonic/gin"
Expand Down Expand Up @@ -174,7 +173,7 @@ func UpdateRepo(c *gin.Context) {
}

// set allow events based on input if given
if !reflect.DeepEqual(input.GetAllowEvents(), new(library.Events)) {
if input.AllowEvents != nil {
r.SetAllowEvents(input.GetAllowEvents())

eventsChanged = true
Expand Down

0 comments on commit 4c8ed98

Please sign in to comment.