This is an automated email from the ASF dual-hosted git repository.

wuweijie pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/shardingsphere-elasticjob.git


The following commit(s) were added to refs/heads/master by this push:
     new 5fcefd1e4 Fix the issue #2105: NullPointerExecption caused by job 
configuration deleted. (#2112)
5fcefd1e4 is described below

commit 5fcefd1e4f78d9f1fd1eec1bbbd84b9e92315730
Author: pandaapo <[email protected]>
AuthorDate: Wed Aug 17 09:27:07 2022 +0800

    Fix the issue #2105: NullPointerExecption caused by job configuration 
deleted. (#2112)
---
 .../elasticjob/lite/internal/config/ConfigurationService.java       | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git 
a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/config/ConfigurationService.java
 
b/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/config/ConfigurationService.java
index c5fa32b04..07eade08b 100644
--- 
a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/config/ConfigurationService.java
+++ 
b/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/config/ConfigurationService.java
@@ -56,7 +56,11 @@ public final class ConfigurationService {
         } else {
             result = 
jobNodeStorage.getJobNodeDataDirectly(ConfigurationNode.ROOT);
         }
-        return YamlEngine.unmarshal(result, 
JobConfigurationPOJO.class).toJobConfiguration();
+        if (result != null) {
+            return YamlEngine.unmarshal(result, 
JobConfigurationPOJO.class).toJobConfiguration();
+        } else {
+            throw new JobConfigurationException("JobConfiguration was not 
found. It maybe has been removed or has not been configured correctly.");
+        }
     }
     
     /**

Reply via email to