zu1k / nali

An offline tool for querying IP geographic information and CDN provider. 一个查询IP地理信息和CDN服务提供商的离线终端工具.
https://github.com/zu1k/nali
MIT License
3.68k stars 335 forks source link

Crash on empty DownloadUrls in the config.yaml #161

Closed oldshensheep closed 1 year ago

oldshensheep commented 1 year ago

After upgrade to 0.7.2, nali will crash if previous config.yaml not exits download-urls in the section of qqwry. E.g.

    - name: qqwry
      name-alias:
        - chunzhen
      format: qqwry
      file: qqwry.dat
      languages:
        - zh-CN
      types:
        - IPv4
panic: runtime error: index out of range [0] with length 0

goroutine 1 [running]:
github.com/zu1k/nali/internal/migration.migration2v7()
        github.com/zu1k/nali/internal/migration/v7.go:32 +0x3a9
github.com/zu1k/nali/internal/migration.init.0()
        github.com/zu1k/nali/internal/migration/mirgration.go:5 +0x1c
zu1k commented 1 year ago

Thanks