Skip to content

Commit c2324eb

Browse files
authored
Merge pull request #291 from Iscle/dev
Do not report a null session to session listeners (#290)
2 parents 0e85e1a + ceea94a commit c2324eb

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

lib/src/main/java/xyz/gianlu/librespot/ZeroconfServer.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,9 +201,10 @@ public void close() throws IOException {
201201
}
202202

203203
public void closeSession() throws IOException {
204-
sessionListeners.forEach(l -> l.sessionClosing(session));
204+
if (session == null) return;
205205

206-
if (session != null) session.close();
206+
sessionListeners.forEach(l -> l.sessionClosing(session));
207+
session.close();
207208
session = null;
208209
}
209210

0 commit comments

Comments
 (0)