Nextcloud custom theme and log filling with json error code 4

Currently using Nextcloud-12.0.5, but this has been a problem also with previous versions.

When using a custom theme, the Nextcloud log is filling rapidly with these error messages:

","url":"\/remote.php\/webdav\/personal","message":"Failed to load
\/var\/www\/html\/nextcloud\/themes\/mytheme - json error code:
4","userAgent":"Mozilla\/5.0 (Macintosh) mirall\/2.2.4 (build 1)

The errors can be eliminated by commenting one line as shown here:

diff -u nextcloud/lib/private/L10N/L10N.php{.orig,}
--- nextcloud/lib/private/L10N/L10N.php.orig    2018-01-24 04:36:27.000000000 -0500
+++ nextcloud/lib/private/L10N/L10N.php 2018-02-11 09:55:55.128440503 -0500
@@ -204,7 +204,7 @@
                $json = json_decode(file_get_contents($translationFile), true);
                if (!is_array($json)) {
                        $jsonError = json_last_error();
-                       \OC::$server->getLogger()->warning("Failed to load $translationFile - json error code: $jsonError", ['app' => 'l10n']);
+                       /*\OC::$server->getLogger()->warning("Failed to load $translationFile - json error code: $jsonError", ['app' => 'l10n']);*/
                        return false;

It looks to me like Nextcloud is trying to load a translation file from an incomplete path.