mirror of
https://github.com/semaphoreui/semaphore.git
synced 2024-11-23 20:35:24 +01:00
Fix nil pointer dereference when updating Template
When updating a template with empty "Extra CLI Arguments" field, the template.Arguments pointer becomes nil. The previous check whether this variable is the empty string fails if it is already nil. The fix introduces a lazy nil check before the empty string-check.
This commit is contained in:
parent
39298cb0d2
commit
bb064198dd
@ -131,7 +131,7 @@ func UpdateTemplate(w http.ResponseWriter, r *http.Request) {
|
||||
return
|
||||
}
|
||||
|
||||
if *template.Arguments == "" {
|
||||
if template.Arguments != nil && *template.Arguments == "" {
|
||||
template.Arguments = nil
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user