Skip to content
Snippets Groups Projects
Commit e0a4a4f6 authored by David Siegfried's avatar David Siegfried
Browse files

prevent php-warnings, closes #2334

Closes #2334

Merge request studip/studip!1528
parent 8a9b8034
No related branches found
No related tags found
1 merge request!4Draft: Icon creation
......@@ -2430,10 +2430,12 @@ class ResourceRequest extends SimpleORMap implements PrivacyObject, Studip\Calen
public function getPriority()
{
if (!isset($this->getTimeIntervals()[0])) {
return 0;
$result = $this->getTimeIntervals();
if (count($result) === 0) {
return null;
}
$first = $this->getTimeIntervals()[0];
$first = $result[0];
return round(($first['begin'] - time()) / 86400);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment