Skip to content

Commit

Permalink
fix: gin.Context nil pointer
Browse files Browse the repository at this point in the history
  • Loading branch information
xhofe committed Jun 26, 2022
1 parent b98cd91 commit 2aff218
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions server/controllers/driver.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package controllers

import (
"fmt"
"github.com/alist-org/alist/v3/internal/operations"
"github.com/alist-org/alist/v3/server/common"
"github.com/gin-gonic/gin"
Expand All @@ -19,8 +20,8 @@ func GetDriverItems(c *gin.Context) {
itemsMap := operations.GetDriverItemsMap()
items, ok := itemsMap[driverName]
if !ok {
common.ErrorStrResp(c, "driver not found", 404)
common.ErrorStrResp(c, fmt.Sprintf("driver [%s] not found", driverName), 404)
return
}
common.SuccessResp(nil, items)
common.SuccessResp(c, items)
}

0 comments on commit 2aff218

Please sign in to comment.