Selaa lähdekoodia

Fixed bug which stopped station module from loading

Kristian Vos 4 vuotta sitten
vanhempi
commit
4de4191851
1 muutettua tiedostoa jossa 5 lisäystä ja 2 poistoa
  1. 5 2
      backend/logic/stations.js

+ 5 - 2
backend/logic/stations.js

@@ -570,7 +570,7 @@ class _StationsModule extends CoreClass {
 					},
 
 					(station, next) => {
-						if (station.playlist.length === 0) next("No songs available.");
+						if (station.playlist.length === 0) next(true, "No songs available.");
 						else {
 							next(null, station.playlist[0]);
 						}
@@ -794,7 +794,10 @@ class _StationsModule extends CoreClass {
 												.then(response => {
 													next(null, response.song, 0, station);
 												})
-												.catch(next);
+												.catch(err => {
+													if (err === "No songs available") next(null, null, 0, station);
+													else next(err);
+												});
 										})
 										.catch(next);
 								})