File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
core/src/main/java/xyz/gianlu/librespot/core Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -221,8 +221,8 @@ public void closeSession() throws IOException {
221221 connectionTime = 0 ;
222222 }
223223
224- private boolean hasActiveSession () {
225- boolean valid = session != null && session .isValid () && session . isActive () ;
224+ private boolean hasValidSession () {
225+ boolean valid = session != null && session .isValid ();
226226 if (!valid ) {
227227 session = null ;
228228 connectionTime = 0 ;
@@ -231,9 +231,13 @@ private boolean hasActiveSession() {
231231 return valid ;
232232 }
233233
234+ private boolean hasActiveSession () {
235+ return hasValidSession () && session .isActive ();
236+ }
237+
234238 private void handleGetInfo (OutputStream out , String httpVersion ) throws IOException {
235239 JsonObject info = DEFAULT_GET_INFO_FIELDS .deepCopy ();
236- info .addProperty ("activeUser" , hasActiveSession () ? session .username () : "" );
240+ info .addProperty ("activeUser" , hasValidSession () ? session .username () : "" );
237241 info .addProperty ("deviceID" , inner .deviceId );
238242 info .addProperty ("remoteName" , inner .deviceName );
239243 info .addProperty ("publicKey" , Base64 .getEncoder ().encodeToString (keys .publicKeyArray ()));
You can’t perform that action at this time.
0 commit comments