Skip to content

Commit 09569b7

Browse files
committed
Refresh the AP pool after stopping the receiver
Before, we tried to refresh the AP pool before stopping the receiver. If the AP pool refresh failed it would throw an exception and the receiver would not be stopped, making it trying to access a null pointer afterwards. This should fix #447.
1 parent 078a196 commit 09569b7

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

lib/src/main/java/xyz/gianlu/librespot/core/Session.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -718,13 +718,13 @@ private void reconnect() {
718718
}
719719

720720
try {
721-
apResolver.refreshPool();
722-
723721
if (conn != null) {
724-
conn.socket.close();
725722
receiver.stop();
723+
conn.socket.close();
726724
}
727725

726+
apResolver.refreshPool();
727+
728728
conn = ConnectionHolder.create(apResolver.getRandomAccesspoint(), inner.conf);
729729
connect();
730730
authenticatePartial(Authentication.LoginCredentials.newBuilder()

0 commit comments

Comments
 (0)