Fix exception mapping with exit codes

- Migitates changed behaviour in boot how exceptions are
  handled thus caused trouble with exit code mappings
  on a shell side.
- Fixes #961
This commit is contained in:
Janne Valkealahti
2023-12-24 08:49:33 +00:00
parent cb8f44ff63
commit 51f49f7567
2 changed files with 11 additions and 3 deletions

View File

@@ -1080,7 +1080,7 @@ public interface CommandRegistration {
@Override
public ExitCodeSpec map(Class<? extends Throwable> e, int code) {
Function<Throwable, Integer> f = t -> {
if (ObjectUtils.nullSafeEquals(t.getClass(), e)) {
if (t != null && ObjectUtils.nullSafeEquals(t.getClass(), e)) {
return code;
}
return 0;