fix #519, change from 'class' comparison to 'inherits'
diff --git a/R/save_kable.R b/R/save_kable.R
index 974ab70..e1e1636 100644
--- a/R/save_kable.R
+++ b/R/save_kable.R
@@ -167,7 +167,7 @@
     table_img_pdf <- try(
       magick::image_read(paste0(file_no_ext, ".pdf"),
                          density = density), silent = T)
-    if (class(table_img_pdf) == "try-error") {
+    if (inherits(table_img_pdf, "try-error")) {
       stop("We hit an error when trying to use magick to read the generated ",
            "PDF file. You may check your magick installation and try to ",
            "use magick::image_read to read the PDF file manually. It's also ",