Skip to content

Commit

Permalink
Fixed #3448 (#3455)
Browse files Browse the repository at this point in the history
  • Loading branch information
glpatcern authored Nov 14, 2022
1 parent 50d1733 commit a11f753
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
5 changes: 5 additions & 0 deletions changelog/unreleased/appprovider-panic-fix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Bugfix: Fixes panic in case of empty configuration

Makes sure the config map is allocated prior to setting it

https://github.com/cs3org/reva/pull/3455
9 changes: 7 additions & 2 deletions internal/grpc/services/appprovider/appprovider.go
Original file line number Diff line number Diff line change
Expand Up @@ -200,8 +200,13 @@ func (s *service) Register(ss *grpc.Server) {
func getProvider(c *config) (app.Provider, error) {
if f, ok := registry.NewFuncs[c.Driver]; ok {
driverConf := c.Drivers[c.Driver]
// share the mime_types config entry to the drivers
driverConf["mime_types"] = c.MimeTypes
if c.MimeTypes != nil {
// share the mime_types config entry to the drivers
if driverConf == nil {
driverConf = make(map[string]interface{})
}
driverConf["mime_types"] = c.MimeTypes
}
return f(driverConf)
}
return nil, errtypes.NotFound("driver not found: " + c.Driver)
Expand Down

0 comments on commit a11f753

Please sign in to comment.