Browse Source

修改崩溃问题

zengminguo 2 years ago
parent
commit
e23f59e2de
1 changed files with 5 additions and 2 deletions
  1. 5 2
      net-service.cpp

+ 5 - 2
net-service.cpp

@@ -225,8 +225,11 @@ void net_service::on_message(const std::shared_ptr<client> &clt,const char*data,
                     site_ptr->set_algo(LDT_PDOA);
 
 					const auto& site_ptr_v = sit_list_v::instance()->get(static_cast<int32_t>(site_id));
-					site_ptr_v->set_algo(LDT_PDOA);
-
+					if (site_ptr_v)
+					{
+						site_ptr_v->set_algo(LDT_PDOA);
+					}
+					
                     //log_info("[scale_test] %.2f", site_ptr->m_scale);
                     struct timeval tv;
                     gettimeofday(&tv, NULL);