i think for two case is better change with :
```
		if ($assetFile === null || !file_exists($assetFile)) {
			$react = $this->settings['react'];

			if ($react) {
				$event->stopPropagation();
				$referer = env('HTTP_REFERER');
				
                if (!Configure::read('debug') || !empty($referer)) {
                    $response->statusCode(404);
                    $response->send();
                    exit();
                }
				throw new NotFoundException('Asset file could not be found.');
			};
			return null;
		}
```
What is the idea?