Skip to content

Commit ceea94a

Browse files
committed
Do not report a null session to session listeners (#290)
1 parent 0e85e1a commit ceea94a

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)