From 574857cdec3c4b51eefd66946eb839ee2581ed01 Mon Sep 17 00:00:00 2001 From: Flaviu Mates Date: Wed, 26 Feb 2020 19:40:42 +0200 Subject: [PATCH] TT#72163 - Fix 500 error on recorded streams * Add check wether recording stream actually exists, to prevent throwing error in case there's a DB entry for the stream, but no actual file is saved Change-Id: Ibd051496f570f05ca7067dcaa9f2f9e85e5d84d6 --- lib/NGCP/Panel/Controller/Subscriber.pm | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lib/NGCP/Panel/Controller/Subscriber.pm b/lib/NGCP/Panel/Controller/Subscriber.pm index 4a9266f209..f701d09e32 100644 --- a/lib/NGCP/Panel/Controller/Subscriber.pm +++ b/lib/NGCP/Panel/Controller/Subscriber.pm @@ -4189,6 +4189,16 @@ sub play_stream :Chained('recording_stream') :PathPart('play') :Args(0) { # TODO: fix to be able to select certain stream my $stream = $c->stash->{stream}; + unless (-e $stream->full_filename) { + NGCP::Panel::Utils::Message::error( + c => $c, + log => "no such recording file for stream with id ".$stream->id, + desc => $c->loc('No such recording file'), + ); + $c->response->redirect($c->uri_for_action('/subscriber/details', [$c->req->captures->[0]])); + $c->detach; + return; + } my $data = read_file($stream->full_filename); my $mime_type; if($stream->file_format eq "wav") {