Skip to content

Discovery of Play:3 crashes #4

Description

@altery

When sonos-java discovers a play:3 on the network it fails to add it as zone because of a NPE. Specifically, the exception occurs when creating the AudioInService -> AbstractService.findService() returns null, which gets passed directly to the constructor of the AudioInService. As the play:3 does not have an audio in, I assume it is an expected behaviour that a service lookup may fail, but sonos-java doesn't handle that case correctly.

Here's the stacktrace:

Daemon Thread [SonosControllerThread] (Suspended (exception NullPointerException))  
    owns: ZonePlayerModel  (id=42)  
    AudioInService(AbstractService).<init>(UpnpService, Service, String) line: 128  
    AudioInService.<init>(UpnpService, Service) line: 41    
    ZonePlayer.<init>(UpnpService, RemoteDevice) line: 112  
    CLIController(AbstractController).addZonePlayer(RemoteDevice) line: 110 
    JavaController$2$1.run() line: 118  
    ThreadPoolExecutor$Worker.runTask(Runnable) line: 886   
    ThreadPoolExecutor$Worker.run() line: 908   
    Thread.run() line: 680  

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions