Skip to content

Commit

Permalink
Merge pull request #12329 from jeromecoutant/PR_ATCELL
Browse files Browse the repository at this point in the history
AT_CellularStack: crash during TCP test
  • Loading branch information
0xc0170 committed Feb 3, 2020
2 parents 62cc4ec + a1fb286 commit 5863415
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions features/cellular/framework/AT/AT_CellularStack.cpp
Expand Up @@ -429,8 +429,10 @@ void AT_CellularStack::socket_attach(nsapi_socket_t handle, void (*callback)(voi
int AT_CellularStack::get_socket_index_by_port(uint16_t port)
{
for (int i = 0; i < _device.get_property(AT_CellularDevice::PROPERTY_SOCKET_COUNT); i++) {
if (_socket[i]->localAddress.get_port() == port) {
return i;
if (_socket[i] != 0) {
if (_socket[i]->localAddress.get_port() == port) {
return i;
}
}
}
return -1;
Expand Down

0 comments on commit 5863415

Please sign in to comment.