mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-07-11 07:46:07 -07:00
Catch json parse error for current activity
This commit is contained in:
parent
38116a14f3
commit
0d38b3de16
1 changed files with 11 additions and 1 deletions
|
@ -103,10 +103,20 @@
|
|||
type: 'GET',
|
||||
cache: false,
|
||||
async: true,
|
||||
error: function (xhr, status, error) {
|
||||
console.log(status + ': ' + error);
|
||||
},
|
||||
complete: function (xhr, status) {
|
||||
$('#dashboard-checking-activity').remove();
|
||||
|
||||
var current_activity = $.parseJSON(xhr.responseText);
|
||||
var current_activity;
|
||||
try {
|
||||
current_activity = $.parseJSON(xhr.responseText);
|
||||
} catch (e) {
|
||||
console.log(status + ': ' + e);
|
||||
current_activity = null;
|
||||
}
|
||||
|
||||
if (!(current_activity)) {
|
||||
$('#currentActivity').html('<div id="dashboard-no-activity" class="text-muted">There was an error communicating with your Plex Server.</div>');
|
||||
return
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue