Skip to content

Commit

Permalink
fix stoi error
Browse files Browse the repository at this point in the history
  • Loading branch information
islandryu committed Feb 9, 2025
1 parent cde7b09 commit b669db4
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions src/inspector_io.cc
Original file line number Diff line number Diff line change
Expand Up @@ -366,12 +366,17 @@ void InspectorIoDelegate::MessageReceived(int session_id,
GetTargetSessionId(message);
std::shared_ptr<MainThreadHandle> worker = nullptr;
int merged_session_id = session_id;
if (!target_session_id_str->empty()) {
int target_session_id = std::stoi(*target_session_id_str);
worker =
protocol::TargetAgent::target_session_id_worker_map_[target_session_id];
if (worker) {
merged_session_id += target_session_id << 16;
if (target_session_id_str) {
bool is_number = std::all_of(target_session_id_str->begin(),
target_session_id_str->end(),
::isdigit);
if (is_number) {
int target_session_id = std::stoi(*target_session_id_str);
worker = protocol::TargetAgent::target_session_id_worker_map_
[target_session_id];
if (worker) {
merged_session_id += target_session_id << 16;
}
}
}

Expand Down

0 comments on commit b669db4

Please sign in to comment.