libnetapi: missing NULL check.

This commit is contained in:
Adrien Destugues 2017-07-25 21:08:56 +02:00
parent f806447f52
commit 615ef07db3

View File

@ -103,6 +103,10 @@ BUrlProtocolAsynchronousListener::MessageReceived(BMessage* message)
message->FindMessage("url:result", &archive); message->FindMessage("url:result", &archive);
BUrlResult* result = dynamic_cast<BUrlResult*>( BUrlResult* result = dynamic_cast<BUrlResult*>(
instantiate_object(&archive)); instantiate_object(&archive));
if (result == NULL) {
debugger("Failed to unarchive BUrlResult");
result = new BUrlResult();
}
HeadersReceived(caller, *result); HeadersReceived(caller, *result);
delete result; delete result;
} }