Handle an error when refreshing the servers list

This commit is contained in:
MagicalCodeMonkey 2020-04-24 11:29:39 -04:00
parent 54e7cb5718
commit 11746e3754
1 changed files with 6 additions and 1 deletions

View File

@ -161,7 +161,12 @@ module.exports = function PlexServer() {
if (!(blur > 0)) {
blur = 0;
}
return `${this.chosenConnection.uri}/photo/:/transcode?url=${location}&X-Plex-Token=${this.accessToken}&height=${Math.floor(height)}&width=${Math.floor(width)}&blur=${blur}`;
if(this.chosenConnection) {
return `${this.chosenConnection.uri}/photo/:/transcode?url=${location}&X-Plex-Token=${this.accessToken}&height=${Math.floor(height)}&width=${Math.floor(width)}&blur=${blur}`;
}
else {
return ``;
}
};
this.getRandomItem = async function () {
try {