Skip to content

Commit

Permalink
Fix null pointer
Browse files Browse the repository at this point in the history
  • Loading branch information
timja committed May 28, 2019
1 parent 9dcd436 commit cd5be43
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions src/main/java/com/sonyericsson/jenkins/plugins/bfa/PluginImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,10 @@ public ScanOnDemandVariables getSodVariables() {
*/
@Restricted(NoExternalUse.class)
public int getMinimumSodWorkerThreads() {
if (sodVariables == null) {
return ScanOnDemandVariables.DEFAULT_MINIMUM_SOD_WORKER_THREADS;
}

return sodVariables.getMinimumSodWorkerThreads();
}

Expand All @@ -252,6 +256,10 @@ public int getMinimumSodWorkerThreads() {
*/
@Restricted(NoExternalUse.class)
public int getMaximumSodWorkerThreads() {
if (sodVariables == null) {
return ScanOnDemandVariables.DEFAULT_MAXIMUM_SOD_WORKER_THREADS;
}

return sodVariables.getMaximumSodWorkerThreads();
}

Expand All @@ -262,6 +270,10 @@ public int getMaximumSodWorkerThreads() {
*/
@Restricted(NoExternalUse.class)
public int getSodThreadKeepAliveTime() {
if (sodVariables == null) {
return ScanOnDemandVariables.DEFAULT_SOD_THREADS_KEEP_ALIVE_TIME;
}

return sodVariables.getSodThreadKeepAliveTime();
}

Expand All @@ -272,6 +284,10 @@ public int getSodThreadKeepAliveTime() {
*/
@Restricted(NoExternalUse.class)
public int getSodWaitForJobShutdownTimeout() {
if (sodVariables == null) {
return ScanOnDemandVariables.DEFAULT_SOD_WAIT_FOR_JOBS_SHUTDOWN_TIMEOUT;
}

return sodVariables.getSodWaitForJobShutdownTimeout();
}

Expand All @@ -282,6 +298,10 @@ public int getSodWaitForJobShutdownTimeout() {
*/
@Restricted(NoExternalUse.class)
public int getSodCorePoolNumberOfThreads() {
if (sodVariables == null) {
return ScanOnDemandVariables.DEFAULT_SOD_COREPOOL_THREADS;
}

return sodVariables.getSodCorePoolNumberOfThreads();
}

Expand Down

0 comments on commit cd5be43

Please sign in to comment.