From 931d5c98ad2ee60246f8070a0e39c3695025ec93 Mon Sep 17 00:00:00 2001
From: Mohammad AlQanneh <mqanneh@gmail.com>
Date: Mon, 2 Mar 2015 14:22:25 +0200
Subject: [PATCH] checked for table existence fb_app before trying to read from
 it. fix to issue #2444207

---
 fb.install | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/fb.install b/fb.install
index b43c404..4837052 100644
--- a/fb.install
+++ b/fb.install
@@ -274,6 +274,13 @@ function fb_update_7400() {
  * Upgrade applications from modules/fb 3.x to 4.x.
  */
 function fb_update_7401() {
+  // Check for table {fb_app} existence .
+  // fb_app module may not be enabled in the older version.
+  // See issue #2444207
+  if (!db_table_exists('fb_app')) {
+    return;
+  }
+  
   require_once(drupal_get_path('module', 'fb') . '/fb.admin.inc');
   $result = db_query("SELECT * FROM {fb_app}");
   while ($row = $result->fetchAssoc()) {
-- 
1.9.1

