diff --git a/src/ScanResultFormatter.php b/src/ScanResultFormatter.php
index e9551f6..bbe69d0 100644
--- a/src/ScanResultFormatter.php
+++ b/src/ScanResultFormatter.php
@@ -161,6 +161,9 @@ class ScanResultFormatter {
     // Otherwise prepare list of errors in groups.
     $groups = [];
     foreach ($result['data']['files'] as $filepath => $errors) {
+      if (!isset($errors['messages'])) {
+        continue;
+      }
       foreach ($errors['messages'] as $error) {
 
         // Remove the Drupal root directory. If this is a composer setup, then
