fix(webui): return an error when fetching an non existent state version
This commit is contained in:
parent
fcc2206124
commit
517c134ccd
1 changed files with 4 additions and 0 deletions
|
@ -32,6 +32,10 @@ func handleVersionGET(db *database.DB) http.Handler {
|
|||
errorResponse(w, http.StatusInternalServerError, err)
|
||||
return
|
||||
}
|
||||
if version == nil {
|
||||
errorResponse(w, http.StatusNotFound, err)
|
||||
return
|
||||
}
|
||||
state, err := db.LoadStateById(version.StateId)
|
||||
if err != nil {
|
||||
errorResponse(w, http.StatusInternalServerError, err)
|
||||
|
|
Loading…
Add table
Reference in a new issue