diff --git a/module/VuFindTheme/src/VuFindTheme/View/Helper/ConcatTrait.php b/module/VuFindTheme/src/VuFindTheme/View/Helper/ConcatTrait.php
index 72ef3705df495bbc1ef2abcd7d1de7a5484883e7..80cefc329385ea0fe60a37aab8b3801e8b9d0360 100644
--- a/module/VuFindTheme/src/VuFindTheme/View/Helper/ConcatTrait.php
+++ b/module/VuFindTheme/src/VuFindTheme/View/Helper/ConcatTrait.php
@@ -145,10 +145,10 @@ trait ConcatTrait
 
     /**
      * Initialize class properties related to concatenation of resources.
-     * All of the elements to be concatenated into ($this->concatItems)
-     * and those that need to remain on their own ($this->otherItems).
+     * All of the elements to be concatenated into groups and
+     * and those that need to remain on their own special group 'other'.
      *
-     * @return void
+     * @return bool True if there are items
      */
     protected function filterItems()
     {
@@ -167,10 +167,23 @@ trait ConcatTrait
                 continue;
             }
 
+            $path = $this->getFileType() . '/' . $this->getResourceFilePath($item);
             $details = $this->themeInfo->findContainingTheme(
-                $this->getFileType() . '/' . $this->getResourceFilePath($item),
+                $path,
                 ThemeInfo::RETURN_ALL_DETAILS
             );
+            // Deal with special case: $path was not found in any theme.
+            if (null === $details) {
+                $errorMsg = "Could not find file '$path' in theme files";
+                method_exists($this, 'logError')
+                    ? $this->logError($errorMsg) : error_log($errorMsg);
+                $this->groups[] = [
+                    'other' => true,
+                    'item' => $item
+                ];
+                $groupTypes[] = 'other';
+                continue;
+            }
 
             $type = $this->getType($item);
             $index = array_search($type, $groupTypes);
diff --git a/module/VuFindTheme/src/VuFindTheme/View/Helper/HeadLink.php b/module/VuFindTheme/src/VuFindTheme/View/Helper/HeadLink.php
index e11cfa4d0f0a8a32bf9f95583c4b4c5015a4d3f7..949ee27d36db57dc3d061f2ac9427397313fe94b 100644
--- a/module/VuFindTheme/src/VuFindTheme/View/Helper/HeadLink.php
+++ b/module/VuFindTheme/src/VuFindTheme/View/Helper/HeadLink.php
@@ -39,8 +39,10 @@ use VuFindTheme\ThemeInfo;
  * @link     https://vufind.org/wiki/development Wiki
  */
 class HeadLink extends \Zend\View\Helper\HeadLink
+    implements \Zend\Log\LoggerAwareInterface
 {
     use ConcatTrait;
+    use \VuFind\Log\LoggerAwareTrait;
 
     /**
      * Theme information service
diff --git a/module/VuFindTheme/src/VuFindTheme/View/Helper/HeadScript.php b/module/VuFindTheme/src/VuFindTheme/View/Helper/HeadScript.php
index d2328c7795637cfbbf6430686ce91691d1522306..0ce0bb835d668dbef964d25515f752ed77219e5f 100644
--- a/module/VuFindTheme/src/VuFindTheme/View/Helper/HeadScript.php
+++ b/module/VuFindTheme/src/VuFindTheme/View/Helper/HeadScript.php
@@ -39,10 +39,12 @@ use VuFindTheme\ThemeInfo;
  * @link     https://vufind.org/wiki/development Wiki
  */
 class HeadScript extends \Zend\View\Helper\HeadScript
+    implements \Zend\Log\LoggerAwareInterface
 {
     use ConcatTrait {
         getMinifiedData as getBaseMinifiedData;
     }
+    use \VuFind\Log\LoggerAwareTrait;
 
     /**
      * Theme information service