mirror of
https://github.com/fnproject/fn.git
synced 2022-10-28 21:29:17 +03:00
@@ -518,7 +518,7 @@ func (ds *BoltDatastore) Get(ctx context.Context, key []byte) ([]byte, error) {
|
||||
}
|
||||
|
||||
func applyAppFilter(app *models.App, filter *models.AppFilter) bool {
|
||||
if filter.Name != "" {
|
||||
if filter != nil && filter.Name != "" {
|
||||
nameLike, err := regexp.MatchString(strings.Replace(filter.Name, "%", ".*", -1), app.Name)
|
||||
return err == nil && nameLike
|
||||
}
|
||||
@@ -527,7 +527,7 @@ func applyAppFilter(app *models.App, filter *models.AppFilter) bool {
|
||||
}
|
||||
|
||||
func applyRouteFilter(route *models.Route, filter *models.RouteFilter) bool {
|
||||
return (filter.Path == "" || route.Path == filter.Path) &&
|
||||
return filter == nil || (filter.Path == "" || route.Path == filter.Path) &&
|
||||
(filter.AppName == "" || route.AppName == filter.AppName) &&
|
||||
(filter.Image == "" || route.Image == filter.Image)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user