Skip to content
This repository was archived by the owner on Sep 16, 2024. It is now read-only.

Commit 2155729

Browse files
author
Rob Rudin
committed
Couple safeguards to avoid NPE on taskExecutor
1 parent 19f0652 commit 2155729

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/main/java/com/marklogic/client/modulesloader/impl/DefaultModulesLoader.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ public DefaultModulesLoader(XccAssetLoader xccAssetLoader) {
8080
this.xccAssetLoader = xccAssetLoader;
8181
}
8282

83-
protected void initializeDefaultTaskExecutor() {
83+
public void initializeDefaultTaskExecutor() {
8484
if (taskThreadCount > 1) {
8585
ThreadPoolTaskExecutor tpte = new ThreadPoolTaskExecutor();
8686
tpte.setCorePoolSize(taskThreadCount);
@@ -530,6 +530,9 @@ public void run() {
530530
* @param r
531531
*/
532532
protected void executeTask(Runnable r) {
533+
if (taskExecutor == null) {
534+
initializeDefaultTaskExecutor();
535+
}
533536
taskExecutor.execute(r);
534537
}
535538

0 commit comments

Comments
 (0)