Skip to content

Commit

Permalink
fix(tiles): more tests and defences - check all tile collections
Browse files Browse the repository at this point in the history
  • Loading branch information
rkettelerij committed Sep 6, 2024
1 parent d11ffd3 commit 580f58a
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,12 @@ func validate(config *Config) error {
if config.OgcAPI.Features != nil {
return validateFeatureCollections(config.OgcAPI.Features.Collections)
}
if config.OgcAPI.Tiles != nil && len(config.OgcAPI.Tiles.Collections) > 0 &&
config.OgcAPI.Tiles.Collections[0].Tiles == nil {
return errors.New("invalid tiles config provided: no tileserver(s) configured for collection-level tiles")
if config.OgcAPI.Tiles != nil && len(config.OgcAPI.Tiles.Collections) > 0 {
for _, coll := range config.OgcAPI.Tiles.Collections {
if coll.Tiles == nil {
return errors.New("invalid tiles config provided: no tileserver(s) configured for collection-level tiles")
}
}
}
return nil
}
Expand Down

0 comments on commit 580f58a

Please sign in to comment.