Emit a diagnostic message instead of crashing when an argument entry is missing.

llvm-svn: 116114
This commit is contained in:
Johnny Chen 2010-10-08 22:01:52 +00:00
parent fc3642b205
commit e6acf35582
1 changed files with 6 additions and 1 deletions

View File

@ -508,7 +508,12 @@ CommandObject::GetArgumentName (CommandArgumentType arg_type)
if (entry->arg_type != arg_type)
entry = CommandObject::FindArgumentDataByType (arg_type);
return entry->arg_name;
if (entry)
return entry->arg_name;
StreamString str;
str << "Arg name for type (" << arg_type << ") not in arg table!";
return str.GetData();
}
bool