Browse Source

Merge branch 'master' of http://local.beijingyongan.com:3000/linux-dev/ya-serv

lixioayao 6 years ago
parent
commit
eb5e5d8d79
2 changed files with 8 additions and 0 deletions
  1. 5 0
      card_base.cpp
  2. 3 0
      monkey_car/monkey_fit.h

+ 5 - 0
card_base.cpp

@@ -57,6 +57,11 @@ void card_location_base::on_message(zloop<task*> * loop,const message_locinfo&lo
 	m_time = loc.m_time_stamp;
 	auto site_ptr = sit_list::instance()->get(loc.m_site_id);
 
+	if(!site_ptr)
+	{
+		return;
+	}
+
 	if(site_ptr->is_up_site())
 	{
 		auto area_tool=get_area_tool();

+ 3 - 0
monkey_car/monkey_fit.h

@@ -44,6 +44,9 @@ struct monkey_fit
 			s-=it->second; ++it;
 		}
 
+		if(p.empty())
+			return 0;
+
 		std::sort(p.begin(),p.end(),[](const std::tuple<T,T,int>&l,const std::tuple<T,T,int>&r){
 			return 1.*std::get<2>(l) > 1.*std::get<2>(r);
 		});