mirror of
https://github.com/zeek/zeek.git
synced 2025-10-04 23:58:20 +00:00
A couple null ptr checks.
This commit is contained in:
parent
daf5d0d098
commit
3c37e818ce
2 changed files with 23 additions and 5 deletions
|
@ -504,17 +504,35 @@ static void WritePluginComponents(FILE* f, const plugin::Plugin* p)
|
|||
{
|
||||
switch ( (*it)->Type() ) {
|
||||
case plugin::component::ANALYZER:
|
||||
WriteAnalyzerComponent(f,
|
||||
dynamic_cast<const analyzer::Component*>(*it));
|
||||
{
|
||||
const analyzer::Component* c =
|
||||
dynamic_cast<const analyzer::Component*>(*it);
|
||||
|
||||
if ( c )
|
||||
WriteAnalyzerComponent(f, c);
|
||||
else
|
||||
reporter->InternalError("component type mismatch");
|
||||
}
|
||||
break;
|
||||
|
||||
case plugin::component::FILE_ANALYZER:
|
||||
WriteAnalyzerComponent(f,
|
||||
dynamic_cast<const file_analysis::Component*>(*it));
|
||||
{
|
||||
const file_analysis::Component* c =
|
||||
dynamic_cast<const file_analysis::Component*>(*it);
|
||||
|
||||
if ( c )
|
||||
WriteAnalyzerComponent(f, c);
|
||||
else
|
||||
reporter->InternalError("component type mismatch");
|
||||
}
|
||||
break;
|
||||
|
||||
case plugin::component::READER:
|
||||
reporter->InternalError("docs for READER component unimplemented");
|
||||
|
||||
case plugin::component::WRITER:
|
||||
reporter->InternalError("docs for WRITER component unimplemented");
|
||||
|
||||
default:
|
||||
reporter->InternalError("docs for unknown component unimplemented");
|
||||
}
|
||||
|
|
|
@ -721,7 +721,7 @@ static char* get_prompt(bool reset_counter = false)
|
|||
string get_context_description(const Stmt* stmt, const Frame* frame)
|
||||
{
|
||||
ODesc d;
|
||||
const BroFunc* func = frame->GetFunction();
|
||||
const BroFunc* func = frame ? frame->GetFunction() : 0;
|
||||
|
||||
if ( func )
|
||||
func->DescribeDebug(&d, frame->GetFuncArgs());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue