Signed-off-by: Ken Swenson <flat@esoteric.moe>
---
src/theme.rs | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/theme.rs b/src/theme.rs
index 5a57c24..db7d268 100644
--- a/src/theme.rs
+++ b/src/theme.rs
@@ -93,9 +93,10 @@ impl ThemeClient {
pub async fn get_theme(&self, theme: &str) -> GarfieldResult<ComicEmbed> {
let count = match self.get_count(theme).await? {
- Some(c) => c,
+ Some(c) => match c { 0 => return Ok(ComicEmbed::new().theme_fail()), _=> c,},
None => return Ok(ComicEmbed::new().theme_fail()),
};
+
let range = rand::distributions::Uniform::new(0, count);
use rand::distributions::Distribution;
--
2.27.0