|
@@ -74,7 +74,7 @@ public class CommandlineProcessor {
|
|
|
try {
|
|
|
if (commandLineArgs.contains(annotation.name())) {
|
|
|
File file = commandLineArgs.getFile(annotation.name());
|
|
|
- if ((file.getName() != null) && !"".equals(file.getName())) {
|
|
|
+ if ((file != null) && (file.getName() != null) && !"".equals(file.getName())) {
|
|
|
method.invoke(null, file);
|
|
|
} else {
|
|
|
if (annotation.defaultValue() != null) {
|
|
@@ -95,11 +95,11 @@ public class CommandlineProcessor {
|
|
|
try {
|
|
|
String value = commandLineArgs.getString(annotation.name());
|
|
|
if ((value == null) || value.isEmpty()) {
|
|
|
- method.invoke(null, commandLineArgs.getString(annotation.name()));
|
|
|
- } else {
|
|
|
if (annotation.defaultValue() != null) {
|
|
|
method.invoke(null, annotation.defaultValue());
|
|
|
}
|
|
|
+ } else {
|
|
|
+ method.invoke(null, commandLineArgs.getString(annotation.name()));
|
|
|
}
|
|
|
} catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e1) {
|
|
|
e1.printStackTrace();
|