Skip to content
Snippets Groups Projects
Commit b3308065 authored by Moritz Strohm's avatar Moritz Strohm
Browse files

fixed exception in case no blubber streams could be found, closes #864

Closes #864

Merge request studip/studip!1073
parent 80290154
No related branches found
No related tags found
No related merge requests found
...@@ -45,16 +45,16 @@ class BlubberController extends AuthenticatedController ...@@ -45,16 +45,16 @@ class BlubberController extends AuthenticatedController
$this->thread = array_pop($threads); $this->thread = array_pop($threads);
} }
$this->thread_data = [];
if ($this->thread) { if ($this->thread) {
$this->thread->markAsRead(); $this->thread->markAsRead();
$this->thread_data = $this->thread->getJSONData(
50,
null,
Request::get("search")
);
} }
$this->thread_data = $this->thread->getJSONData(
50,
null,
Request::get("search")
);
if (!Avatar::getAvatar($GLOBALS['user']->id)->is_customized() && !$_SESSION['already_asked_for_avatar']) { if (!Avatar::getAvatar($GLOBALS['user']->id)->is_customized() && !$_SESSION['already_asked_for_avatar']) {
$_SESSION['already_asked_for_avatar'] = true; $_SESSION['already_asked_for_avatar'] = true;
PageLayout::postInfo(sprintf( PageLayout::postInfo(sprintf(
......
<div class="blubber_panel" <div class="blubber_panel"
data-active_thread="<?= htmlReady($thread->getId()) ?>" data-active_thread="<?= htmlReady(!empty($thread) ? $thread->getId() : '') ?>"
data-thread_data="<?= htmlReady(json_encode($thread_data ?: ['thread_posting' => []])) ?>" data-thread_data="<?= htmlReady(json_encode($thread_data ?: ['thread_posting' => []])) ?>"
data-threads_more_down="<?= htmlReady($threads_more_down) ?>" data-threads_more_down="<?= htmlReady($threads_more_down) ?>"
:class="waiting ? 'waiting' : ''"> :class="waiting ? 'waiting' : ''">
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment