Skip to content

Commit

Permalink
make code null safe on shutdown (jupnp#102)
Browse files Browse the repository at this point in the history
Signed-off-by: Kai Kreuzer <[email protected]>
  • Loading branch information
kaikreuzer authored Jun 26, 2018
1 parent e0cea28 commit 53a4da0
Showing 1 changed file with 10 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@

package org.jupnp.protocol.async;

import java.util.concurrent.Executor;

import org.jupnp.UpnpService;
import org.jupnp.UpnpServiceConfiguration;
import org.jupnp.model.ValidationError;
import org.jupnp.model.ValidationException;
import org.jupnp.model.message.IncomingDatagramMessage;
Expand Down Expand Up @@ -98,9 +101,13 @@ protected void execute() throws RouterException {
return;
}

getUpnpService().getConfiguration().getAsyncProtocolExecutor()
.execute(new RetrieveRemoteDescriptors(getUpnpService(), rd));

UpnpServiceConfiguration conf = getUpnpService().getConfiguration();
if (conf != null) {
Executor executor = conf.getAsyncProtocolExecutor();
if (executor != null) {
executor.execute(new RetrieveRemoteDescriptors(getUpnpService(), rd));
}
}
}

}

0 comments on commit 53a4da0

Please sign in to comment.