diff --git a/wp-mat.php b/wp-mat.php
index 4b9d8bdd0aa14e72adf887724f43c4e24ad1176e..64eb8b2be335764c6e24ccd18c489877bb71a2d5 100644
--- a/wp-mat.php
+++ b/wp-mat.php
@@ -3,7 +3,7 @@
  * Plugin Name: wp-mat
  * Plugin URI: https://git.autistici.org/noblogs/wp-mat
  * Description: Process uploaded files through MAT
- * Version: 0.0.1
+ * Version: 0.0.4
  * Author: Autistici/Inventati
  * Author URI: https://www.autistici.org/
  * License: MIT
@@ -51,7 +51,10 @@ function wp_mat_issue_request($path, $mimetype, $output_path) {
 }
 
 function wp_mat_handle_upload_prefilter($file) {
-    if (isset($file['error'])) {
+    error_log("wp-mat: called with file=".json_encode($file));
+
+    if (isset($file['error']) && $file['error']) {
+        error_log("wp-mat: upload has error set to ".$file['error']);
         return $file;
     }