Skip to content

Commit

Permalink
avoiding the NPE if there is no default command in a group
Browse files Browse the repository at this point in the history
  • Loading branch information
mhgrove committed Jan 23, 2013
1 parent 4254454 commit f8bb877
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/main/java/io/airlift/command/model/MetadataLoader.java
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,10 @@ public CommandMetadata apply(Class<?> commandType)

public static CommandMetadata loadCommand(Class<?> commandType)
{
if (commandType == null) {
return null;
}

Command command = null;
for (Class<?> cls = commandType; command == null && !Object.class.equals(cls); cls = cls.getSuperclass()) {
command = cls.getAnnotation(Command.class);
Expand Down

0 comments on commit f8bb877

Please sign in to comment.