mirror of
https://github.com/nim-lang/Nim.git
synced 2026-07-22 08:51:21 +00:00
Atlas: avoid segfault on failed Github search (#21980)
* Atlas: avoid segfault on failed Github search * Return empty array on failed search instead of nil
This commit is contained in:
@@ -79,7 +79,7 @@ proc singleGithubSearch(term: string): JsonNode =
|
||||
let x = client.getContent("https://api.github.com/search/repositories?q=" & encodeUrl(term) & "+language:nim")
|
||||
result = parseJson(x)
|
||||
except:
|
||||
discard "it's a failed search, ignore"
|
||||
result = parseJson("{\"items\": []}")
|
||||
finally:
|
||||
client.close()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user