fixed some base cases
This commit is contained in:
@@ -115,6 +115,9 @@ func get_image(sub string) <-chan string {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// nothing found
|
||||||
|
ret <- ""
|
||||||
|
|
||||||
}()
|
}()
|
||||||
|
|
||||||
return ret
|
return ret
|
||||||
@@ -260,7 +263,7 @@ func get_subreddit_image(sub string) <-chan string {
|
|||||||
if hint == "image" || hint == "link" || hint == "rich:video" {
|
if hint == "image" || hint == "link" || hint == "rich:video" {
|
||||||
image, _ := jsonparser.GetString(out, "data", "children", "[" + strconv.Itoa(random_img) + "]", "data", "url")
|
image, _ := jsonparser.GetString(out, "data", "children", "[" + strconv.Itoa(random_img) + "]", "data", "url")
|
||||||
ret <- image
|
ret <- image
|
||||||
break
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
|
Reference in New Issue
Block a user