Fix crash caused by corrupted mbtiles file (#55)

This commit is contained in:
Nikolay Korotkiy 2019-11-08 01:32:47 +03:00
parent ab619df2e3
commit 54f689c6a3
No known key found for this signature in database
GPG Key ID: D1DE6D7F693663A5

View File

@ -13,6 +13,7 @@ import (
"fmt"
"html/template"
"io"
log "github.com/sirupsen/logrus"
"net/http"
"os"
"path/filepath"
@ -200,7 +201,7 @@ func NewFromBaseDir(baseDir string, secretKey string) (*ServiceSet, error) {
id := p[:len(p)-len(e)]
err = s.AddDBOnPath(filename, id)
if err != nil {
return nil, err
log.Warnf("Skipping corrupt mbtiles '%s': %s", filename, err.Error())
}
}
return s, nil