Skip to content
Permalink
Browse files
JENKINS-29421 Resolve NullPointerException
  • Loading branch information
rossrowe committed Jul 23, 2015
1 parent 069be26 commit f0857f521500289159e1fb7bdafd55bf44b08e6d
Showing with 8 additions and 9 deletions.
  1. +8 −9 src/main/java/hudson/plugins/sauce_ondemand/SauceOnDemandBuildWrapper.java
@@ -374,11 +374,15 @@ public Environment setUp(final AbstractBuild build, Launcher launcher, BuildList
public void buildEnvVars(Map<String, String> env) {
logger.fine("Creating Sauce environment variables");
List<Browser> browsers = new ArrayList<Browser>();
for (String webDriverBrowser : webDriverBrowsers) {
browsers.add(BROWSER_FACTORY.webDriverBrowserForKey(webDriverBrowser, useLatestVersion));
if (webDriverBrowsers != null) {
for (String webDriverBrowser : webDriverBrowsers) {
browsers.add(BROWSER_FACTORY.webDriverBrowserForKey(webDriverBrowser, useLatestVersion));
}
}
for (String appiumBrowser : appiumBrowsers) {
browsers.add(BROWSER_FACTORY.appiumBrowserForKey(appiumBrowser));
if (appiumBrowsers != null) {
for (String appiumBrowser : appiumBrowsers) {
browsers.add(BROWSER_FACTORY.appiumBrowserForKey(appiumBrowser));
}
}
SauceEnvironmentUtil.outputVariables(env, browsers, getUserName(), getApiKey());
//if any variables have been defined in build variables (ie. by a multi-config project), use them
@@ -643,10 +647,7 @@ public String getUserName() {
return getCredentials().getUsername();
} else {
PluginImpl p = PluginImpl.get();

return p.getUsername();


}
}

@@ -658,9 +659,7 @@ public String getApiKey() {
return getCredentials().getApiKey();
} else {
PluginImpl p = PluginImpl.get();

return Secret.toString(p.getApiKey());

}
}

0 comments on commit f0857f5

Please sign in to comment.