mirror of https://github.com/Xhofe/alist
fix: gin.Context nil pointer
parent
b98cd915a4
commit
2aff218356
|
@ -1,6 +1,7 @@
|
||||||
package controllers
|
package controllers
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"fmt"
|
||||||
"github.com/alist-org/alist/v3/internal/operations"
|
"github.com/alist-org/alist/v3/internal/operations"
|
||||||
"github.com/alist-org/alist/v3/server/common"
|
"github.com/alist-org/alist/v3/server/common"
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
|
@ -19,8 +20,8 @@ func GetDriverItems(c *gin.Context) {
|
||||||
itemsMap := operations.GetDriverItemsMap()
|
itemsMap := operations.GetDriverItemsMap()
|
||||||
items, ok := itemsMap[driverName]
|
items, ok := itemsMap[driverName]
|
||||||
if !ok {
|
if !ok {
|
||||||
common.ErrorStrResp(c, "driver not found", 404)
|
common.ErrorStrResp(c, fmt.Sprintf("driver [%s] not found", driverName), 404)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
common.SuccessResp(nil, items)
|
common.SuccessResp(c, items)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue