diff --git a/core/modules/locale/locale.batch.inc b/core/modules/locale/locale.batch.inc
index 67ce5d8..5ccb6ef 100644
--- a/core/modules/locale/locale.batch.inc
+++ b/core/modules/locale/locale.batch.inc
@@ -243,17 +243,18 @@ function locale_translation_http_check($uri) {
   }
   catch (RequestException $e) {
     // Handle 4xx and 5xx http responses.
-    $response = $e->getResponse();
-    if ($response->getStatusCode() == 404) {
-      // File not found occurs when a translation file is not yet available
-      // at the translation server. But also if a custom module or custom
-      // theme does not define the location of a translation file. By default
-      // the file is checked at the translation server, but it will not be
-      // found there.
-      $logger->notice('Translation file not found: @uri.', array('@uri' => $uri));
-      return TRUE;
+    if ($response = $e->getResponse()) {
+      if ($response->getStatusCode() == 404) {
+        // File not found occurs when a translation file is not yet available
+        // at the translation server. But also if a custom module or custom
+        // theme does not define the location of a translation file. By default
+        // the file is checked at the translation server, but it will not be
+        // found there.
+        $logger->notice('Translation file not found: @uri.', array('@uri' => $uri));
+        return TRUE;
+      }
+      $logger->notice('HTTP request to @url failed with error: @error.', array('@url' => $uri, '@error' => $response->getStatusCode() . ' ' . $response->getReasonPhrase()));
     }
-    $logger->notice('HTTP request to @url failed with error: @error.', array('@url' => $uri, '@error' => $response->getStatusCode() . ' ' . $response->getReasonPhrase()));
   }
 
   return FALSE;
