Merge "frequencyQuery: stop with error if vc is empty"
diff --git a/R/KorAPQuery.R b/R/KorAPQuery.R
index cf848f0..5ba459b 100644
--- a/R/KorAPQuery.R
+++ b/R/KorAPQuery.R
@@ -346,6 +346,7 @@
         corpusQuery(kco, query, vc, metadataOnly = TRUE, as.df = TRUE, ...) %>%
         mutate(total = corpusStats(kco, vc=vc, as.df=TRUE)$tokens)
       } ) %>%
+      { if (.$total == 0)  stop(paste0("Virtual corpus \"",vc, "\" is empty. Cannot calculate relative frequencies."), call. = FALSE) }
       ci(conf.level = conf.level)
 })