Skip to content

Commit

Permalink
Added safe checks
Browse files Browse the repository at this point in the history
  • Loading branch information
gastaldi committed Aug 29, 2013
1 parent 1ac2dd5 commit c000ede
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import org.jboss.aesh.complete.CompleteOperation;
import org.jboss.aesh.complete.Completion;
import org.jboss.aesh.parser.Parser;
import org.jboss.forge.addon.convert.ConverterFactory;
import org.jboss.forge.addon.shell.ShellImpl;
import org.jboss.forge.addon.shell.aesh.AbstractShellInteraction;
import org.jboss.forge.addon.shell.ui.ShellContext;
Expand Down Expand Up @@ -95,11 +96,15 @@ else if (completeObject.isArgument())
input = null;
}
String typedValue = completeObject.getValue();
if (typedValue == null)
{
typedValue = "";
}
if (input != null)
{
ConverterFactory converterFactory = shell.getConverterFactory();
CompletionStrategy completionObj = CompletionStrategyFactory.getCompletionFor(input);
completionObj.complete(completeOperation, input, shellContext, typedValue,
shell.getConverterFactory());
completionObj.complete(completeOperation, input, shellContext, typedValue, converterFactory);
}
// if we only have one complete candidate, leave the escaped space be
List<String> candidates = completeOperation.getCompletionCandidates();
Expand Down

0 comments on commit c000ede

Please sign in to comment.