diff --git a/gist_filter.module b/gist_filter.module
index 0819bd9..441924c 100644
--- a/gist_filter.module
+++ b/gist_filter.module
@@ -99,10 +99,16 @@ function _gist_display_code($matches) {
   }
   // Otherwise, render all files.
   else {
-    foreach ($data['files'] as $file) {
-      $output .= theme('gist_filter_code', array(
-        'file' => $file,
-      ));
+    if (isset($data['files'])) {
+      foreach ($data['files'] as $file) {
+        $output .= theme('gist_filter_code', array(
+          'file' => $file,
+        ));
+      }
+    }
+    else {
+      // There may be a message here.
+      watchdog('gist_filter', 'Possible error retrieving gist %gist_id: "%json"', array('%gist_id' => $matches[1], '%json' => print_r($data, true)), WATCHDOG_ERROR);
     }
   }
 
