Skip to content

Commit 781f340

Browse files
ACPT-1929: Fixing race conditions in ACPT-1493
Adding exclicit exception for when JSON file is corrupt. This will give more useful error messages if people make broken json files.
1 parent 43df2ac commit 781f340

File tree

1 file changed

+4
-0
lines changed
  • lib/internal/Magento/Framework/ObjectManager/Resetter

1 file changed

+4
-0
lines changed

lib/internal/Magento/Framework/ObjectManager/Resetter/Resetter.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
use Magento\Framework\Component\ComponentRegistrar;
1111
use Magento\Framework\Component\ComponentRegistrarInterface;
12+
use Magento\Framework\Exception\LocalizedException;
1213
use Magento\Framework\ObjectManager\ResetAfterRequestInterface;
1314
use Magento\Framework\ObjectManagerInterface;
1415
use WeakMap;
@@ -53,6 +54,9 @@ public function __construct(
5354
continue;
5455
}
5556
$resetData = \json_decode(\file_get_contents($resetPath), true);
57+
if (!$resetData) {
58+
throw new LocalizedException(__('Error parsing %1', $resetPath));
59+
}
5660
$this->classList = array_replace($this->classList, $resetData);
5761
}
5862
$this->resetAfterWeakMap = new WeakMap;

0 commit comments

Comments
 (0)