From 5e3b1842757e9c83faf961ac9d198a863a37b0d7 Mon Sep 17 00:00:00 2001
From: David Siegfried <david.siegfried@uni-vechta.de>
Date: Mon, 20 Nov 2023 08:51:10 +0000
Subject: [PATCH] prevent php-warnings, closes #3488

Closes #3488

Merge request studip/studip!2383
---
 app/controllers/oer/endpoints.php | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/app/controllers/oer/endpoints.php b/app/controllers/oer/endpoints.php
index 813e31dc3c8..cbd4b884593 100644
--- a/app/controllers/oer/endpoints.php
+++ b/app/controllers/oer/endpoints.php
@@ -324,6 +324,9 @@ class Oer_EndpointsController extends StudipController
         }
         page_close();
 
+        if (!file_exists($this->material->getFilePath())) {
+            throw new Exception(_('Die gewünschte Datei konnte nicht gefunden werden.'));
+        }
         $filesize = filesize($this->material->getFilePath());
         header("Accept-Ranges: bytes");
         $start = 0;
-- 
GitLab