Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d79f0d2e authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "RFComm: Check for nullptr in PORT_IsOpening logs"

parents 658b099c b74aaeb8
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -498,7 +498,7 @@ bool PORT_IsOpening(RawAddress* bd_addr) {
    if ((multiplexer_cb.state > RFC_MX_STATE_IDLE) &&
        (multiplexer_cb.state < RFC_MX_STATE_CONNECTED)) {
      *bd_addr = multiplexer_cb.bd_addr;
      LOG_DEBUG(
      LOG_INFO(
          "Found a rfc_mcb in the middle of opening a port, returning true");
      return true;
    }
@@ -515,20 +515,20 @@ bool PORT_IsOpening(RawAddress* bd_addr) {
        }
      }

      LOG_DEBUG("RFC_MX_STATE_CONNECTED, found_port=%d, tRFC_PORT_STATE=%d",
                found_port, p_port->rfc.state);
      LOG_INFO("RFC_MX_STATE_CONNECTED, found_port=%d, tRFC_PORT_STATE=%d",
               found_port, p_port != nullptr ? p_port->rfc.state : 0);
      if ((!found_port) ||
          (found_port && (p_port->rfc.state < RFC_STATE_OPENED))) {
        /* Port is not established yet. */
        *bd_addr = multiplexer_cb.bd_addr;
        LOG_DEBUG(
        LOG_INFO(
            "In RFC_MX_STATE_CONNECTED but port is not established yet, "
            "returning true");
        return true;
      }
    }
  }
  LOG_DEBUG("false");
  LOG_INFO("false");
  return false;
}