Skip to content

Commit 0c269b7

Browse files
fix: Avoid NPE in destroyProcess call (#1878)
1 parent 06ce52a commit 0c269b7

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/main/java/io/appium/java_client/service/local/AppiumDriverLocalService.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ public final class AppiumDriverLocalService extends DriverService {
5454

5555
private static final String URL_MASK = "http://%s:%d/";
5656
private static final Logger LOG = LoggerFactory.getLogger(AppiumDriverLocalService.class);
57-
private static final Pattern LOG_MESSAGE_PATTERN = Pattern.compile("^(.*)\\R");
5857
private static final Pattern LOGGER_CONTEXT_PATTERN = Pattern.compile("^(\\[debug\\] )?\\[(.+?)\\]");
5958
private static final String APPIUM_SERVICE_SLF4J_LOGGER_PREFIX = "appium.service";
6059
private static final Duration DESTROY_TIMEOUT = Duration.ofSeconds(60);
@@ -217,7 +216,7 @@ public void stop() {
217216
* @return The exit code of the process or zero if the process was not running.
218217
*/
219218
private int destroyProcess(Duration timeout) {
220-
if (!process.isRunning()) {
219+
if (process == null || !process.isRunning()) {
221220
return 0;
222221
}
223222

0 commit comments

Comments
 (0)