diff --git a/fb.js b/fb.js
index 9965e99..f931c67 100644
--- a/fb.js
+++ b/fb.js
@@ -302,7 +302,8 @@ FB_JS.deleteCookie = function( name, path, domain ) {
 
       // Once upon a time, we initialized facebook's JS SDK here, but now that is done in fb_footer().
 
-      if (typeof(FB) != 'undefined') {
+      // Check for a null apiKey: http://drupal.org/node/1480868
+      if (typeof(FB) != 'undefined' && FB._apiKey != null) {
         // Render any XFBML markup that may have been added by AJAX.
         $(context).each(function() {
           var elem = $(this).get(0);
