diff --git a/includes/locale.inc b/includes/locale.inc
index c168da0..46a3293 100644
--- a/includes/locale.inc
+++ b/includes/locale.inc
@@ -1484,6 +1484,12 @@ function _locale_parse_js_file($filepath) {
   // actual file.
   $parsed_url = drupal_parse_url($filepath);
   $filepath = $parsed_url['path'];
+
+  // Make sure the file actually exists.
+  if (!file_exists($filepath)) {
+    return;
+  }
+
   // Load the JavaScript file.
   $file = file_get_contents($filepath);
 
diff --git a/modules/locale/locale.test b/modules/locale/locale.test
index 9ffec9f..6bb008f 100644
--- a/modules/locale/locale.test
+++ b/modules/locale/locale.test
@@ -18,6 +18,7 @@
  *  - a functional test for multilingual fields.
  *  - a functional test for comment language.
  *  - a functional test fot language types/negotiation info.
+ *  - a test to ensure that adding a non-existent javascript file doesn't cause a php error.
  */
 
 
@@ -3141,3 +3142,31 @@ class LocaleCSSAlterTest extends DrupalWebTestCase {
     $this->assertRaw('@import url("' . $base_url . '/modules/system/system.messages.css' . $query_string . '");' . "\n" . '@import url("' . $base_url . '/modules/system/system.messages-rtl.css' . $query_string . '");' . "\n", 'CSS: system.messages-rtl.css is added directly after system.messages.css.');
   }
 }
+
+/**
+ * Tests adding a non-existent javascript file to ensure it doesn't cause a PHP error.
+ */
+class LocaleAddJSTest extends DrupalWebTestCase {
+    public static function getInfo() {
+        return array(
+            'name' => 'Add JavaScript handling',
+            'description' => 'Tests adding JavaScript when locale module enabled',
+            'group' => 'Locale',
+        );
+    }
+
+    function setUp() {
+        parent::setUp('locale_test_add_js');
+    }
+
+    /**
+     * Tests drupal_add_js() on a non-existent file while the locale module
+     * is enabled, to ensure that an error message is not thrown.
+     */
+    function testLocaleAddJS() {
+        // Request the page that attempts to add a non-existent JavaScript file.
+        // As this test is testing for a PHP error, no assertions are needed
+        // as the error in question will throw an exception causing the test to fail.
+        $this->drupalGet('locale_non_existent_js_path');
+    }
+}
diff --git a/modules/locale/tests/locale_test_add_js.info b/modules/locale/tests/locale_test_add_js.info
new file mode 100644
index 0000000..34a8825
--- /dev/null
+++ b/modules/locale/tests/locale_test_add_js.info
@@ -0,0 +1,7 @@
+name = Locale test add js
+description = Support module for adding javascript with the Interface Translation (locale) module enabled.
+package = Testing
+version = 1.0
+core = 7.x
+dependencies[] = locale
+hidden = TRUE
diff --git a/modules/locale/tests/locale_test_add_js.module b/modules/locale/tests/locale_test_add_js.module
new file mode 100644
index 0000000..2b3192d
--- /dev/null
+++ b/modules/locale/tests/locale_test_add_js.module
@@ -0,0 +1,30 @@
+<?php
+
+/**
+ * @file
+ * Attempts to add a non-existent JS file to
+ * test for non-existence of error message
+ */
+
+/**
+ * Implements hook_menu().
+ *
+ * Creates a menu path at /locale_non_existent_js_path
+ * on which a non-existent JavaScript file will
+ * be attempted to be added.
+ */
+function locale_test_add_js_menu() {
+  $items['locale_non_existent_js_path'] = array(
+    'title' => 'Locale non-existent JS test page',
+    'page callback' => 'locale_test_add_js_page',
+    'access callback' => TRUE,
+  );
+
+  return $items;
+}
+
+function locale_test_add_js_page() {
+  drupal_add_js(drupal_get_path('module', 'locale_test_add_js') . '/non_existent_js_file.js');
+
+  return t('This page simply attempts to add a non-existent javascript file.');
+}
