From 92611e03e43ac423f88e74d606bfee258f2db082 Mon Sep 17 00:00:00 2001 From: Jebb Date: Tue, 5 Dec 2023 14:55:53 +0800 Subject: [PATCH] #168: Catch missing file --- controller/file.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/controller/file.php b/controller/file.php index 76ce3ac3..abbb3997 100644 --- a/controller/file.php +++ b/controller/file.php @@ -76,6 +76,10 @@ protected function _actionRender(KControllerContextInterface $context) { $file = $this->getModel()->fetch(); + if ($file->isNew()) { + throw new KControllerExceptionResourceNotFound('File not found'); + } + try { $this->getResponse()