Skip to content

Commit 0b2720b

Browse files
committed
Fixed NPE bug
1 parent 1dcf7c3 commit 0b2720b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/main/java/in/erail/scheduler/QuartzJobFactory.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,13 +182,13 @@ protected void setBeanProps(Object obj, JobDataMap data) throws SchedulerExcepti
182182
"The setter on Job class " + obj.getClass().getName()
183183
+ " for property '" + name
184184
+ "' expects a " + paramType
185-
+ " but was given " + o.getClass().getName(), nfe);
185+
+ " but was given " + Optional.ofNullable(o).map(p -> p.getClass().getName()).orElse("null"), nfe);
186186
} catch (IllegalArgumentException e) {
187187
handleError(
188188
"The setter on Job class " + obj.getClass().getName()
189189
+ " for property '" + name
190190
+ "' expects a " + paramType
191-
+ " but was given " + o.getClass().getName(), e);
191+
+ " but was given " + Optional.ofNullable(o).map(p -> p.getClass().getName()).orElse("null"), e);
192192
} catch (IllegalAccessException e) {
193193
handleError(
194194
"The setter on Job class " + obj.getClass().getName()

0 commit comments

Comments
 (0)