fixed gpkg file check
@@ -6,6 +6,7 @@ import (
"database/sql"
"errors"
"fmt"
+ "os"
"regexp"
"sort"
"strings"
@@ -191,6 +192,11 @@ func NewTileProvider(config map[string]interface{}) (provider.Tiler, error) {
return nil, ErrInvalidFilePath{filepath}
}
+ // check the file exists
+ if _, err := os.Stat(filepath); os.IsNotExist(err) {
+ return nil, ErrInvalidFilePath{filepath}
+ }
+
db, err := sql.Open("sqlite3", filepath)
if err != nil {
return nil, err
