Skip to content

Commit c317cbb

Browse files
author
Vasyl Vavrychuk
committed
fixed crashing
1 parent db37634 commit c317cbb

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/webdriver/commands/xdrpc_command.cc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,13 @@ void XDRPCCommand::ExecutePost(Response* const response) {
3838
std::string matched_route;
3939
AbstractCommandCreator* cmdCreator =
4040
Server::GetInstance()->GetRouteTable().GetRouteForURL(path, &matched_route);
41+
if (NULL == cmdCreator)
42+
{
43+
response->SetError(new Error(
44+
kBadRequest, "no route for url: " + path));
45+
return;
46+
}
47+
4148
Command* command = cmdCreator->create(path_segments, parameters);
4249

4350
Server::GetInstance()->DispatchCommand(

0 commit comments

Comments
 (0)