diff --git a/core/modules/locale/locale.module b/core/modules/locale/locale.module
index ca8df47..e7b193d 100644
--- a/core/modules/locale/locale.module
+++ b/core/modules/locale/locale.module
@@ -1116,6 +1116,11 @@ function _locale_parse_js_file($filepath) {
     throw new Exception('Only local files should be passed to _locale_parse_js_file().');
   }
 
+  // Make sure the file actually exists.
+  if (!file_exists($filepath)) {
+    return;
+  }
+
   // Load the JavaScript file.
   $file = file_get_contents($filepath);
 
diff --git a/core/modules/locale/src/Tests/LocaleAddJSTest.php b/core/modules/locale/src/Tests/LocaleAddJSTest.php
new file mode 100644
index 0000000..ab768f3
--- /dev/null
+++ b/core/modules/locale/src/Tests/LocaleAddJSTest.php
@@ -0,0 +1,36 @@
+<?php
+
+/**
+ * @file
+ * Definition of Drupal\locale\Tests\LocaleAddJSTest.
+ */
+
+namespace Drupal\locale\Tests;
+
+use Drupal\simpletest\WebTestBase;
+
+/**
+ * Tests adding JavaScript when locale module is enabled
+ *
+ * @group locale
+ */
+class LocaleAddJSTest extends WebTestBase {
+
+  /**
+   * Modules to enable.
+   *
+   * @var array
+   */
+  public static $modules = array('locale_test_add_js');
+
+  /**
+   * Tests adding a non-existent javascript file while the locale module
+   * is enabled, to ensure that an error message is not thrown.
+   */
+  function testLocaleAddJS() {
+    // Request a 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('');
+  }
+}
diff --git a/core/modules/locale/tests/modules/locale_test_add_js/locale_test_add_js.info.yml b/core/modules/locale/tests/modules/locale_test_add_js/locale_test_add_js.info.yml
new file mode 100644
index 0000000..b3a69d6
--- /dev/null
+++ b/core/modules/locale/tests/modules/locale_test_add_js/locale_test_add_js.info.yml
@@ -0,0 +1,9 @@
+name: Locale test add js
+type: module
+description: Support module for adding javascript with the Interface Translation (locale) module enabled.
+package: Testing
+version: 1.0
+core: 8.x
+dependencies:
+  - locale
+hidden: true
diff --git a/core/modules/locale/tests/modules/locale_test_add_js/locale_test_add_js.module b/core/modules/locale/tests/modules/locale_test_add_js/locale_test_add_js.module
new file mode 100644
index 0000000..ae1d424
--- /dev/null
+++ b/core/modules/locale/tests/modules/locale_test_add_js/locale_test_add_js.module
@@ -0,0 +1,16 @@
+<?php
+
+/**
+ * @file
+ * Attempts to add a non-existent JS file to
+ * test for non-existence of error message
+ */
+
+/**
+ * Implements hook_page_attachments().
+ * Adds a non existent js file to the page
+ */
+function locale_test_add_js_page_attachments(&$page) {
+  $page['#attached']['library'][] =
+    drupal_get_path('module', 'locale_test_add_js') . '/non_existent_js_file.js';
+}
