From 73f51f75b10614add0fbac2a10565e91aa4f8fc2 Mon Sep 17 00:00:00 2001 From: Marcel Pfotenhauer Date: Wed, 26 Aug 2020 13:38:30 +0200 Subject: [PATCH] #124: improved getters for proxy and webDriver --- src/main/java/com/xceptance/neodymium/util/Neodymium.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/xceptance/neodymium/util/Neodymium.java b/src/main/java/com/xceptance/neodymium/util/Neodymium.java index b630c6d1f..1f841ae1a 100644 --- a/src/main/java/com/xceptance/neodymium/util/Neodymium.java +++ b/src/main/java/com/xceptance/neodymium/util/Neodymium.java @@ -143,7 +143,8 @@ public static WebDriverStateContainer getWebDriverStateContainer() public static WebDriver getDriver() { - return getContext().webDriverStateContainer != null ? getContext().webDriverStateContainer.getWebDriver() : null; + final WebDriverStateContainer wDSC = getContext().webDriverStateContainer; + return wDSC == null ? null : wDSC.getWebDriver(); } public static EventFiringWebDriver getEventFiringWebdriver() @@ -158,7 +159,8 @@ public static RemoteWebDriver getRemoteWebDriver() public static BrowserUpProxy getLocalProxy() { - return getContext().webDriverStateContainer != null ? getContext().webDriverStateContainer.getProxy() : null; + final WebDriverStateContainer wDSC = getContext().webDriverStateContainer; + return wDSC == null ? null : wDSC.getProxy(); } public static String getBrowserProfileName()