🐛 Fix npe

This commit is contained in:
Liang Ding 2022-06-07 18:59:25 +08:00
parent 3aced60e8c
commit b08910aacc
No known key found for this signature in database
GPG key ID: 136F30F901A2231D

View file

@ -33,7 +33,7 @@ func GetRhyResult(force bool, proxyURL string) (map[string]interface{}, error) {
defer rhyResultLock.Unlock()
now := time.Now().Unix()
if 3600 >= now-rhyResultCacheTime && !force {
if 3600 >= now-rhyResultCacheTime && !force && 0 < len(cachedRhyResult) {
return cachedRhyResult, nil
}