Browse Source

area-path定义错误时放弃初始化

zzj 6 years ago
parent
commit
6ed8285089
1 changed files with 3 additions and 1 deletions
  1. 3 1
      area.cpp

+ 3 - 1
area.cpp

@@ -412,8 +412,9 @@ void area_list::init_from_db(int id/*=-1*/)
     init_monkeycar_area(id);
 }
 
-std::vector<point> area_list::init_path(std::string &str,int area_id)
+std::vector<point> area_list::init_path(std::string &str_0,int area_id)
 {
+	const std::string str=str_0;
 	if(str.empty())
 	{
 	  log_error("area path is empty,area_id=%d.",area_id);
@@ -430,6 +431,7 @@ std::vector<point> area_list::init_path(std::string &str,int area_id)
 		if(vs1.size()!=2)
 		{
 		  log_error("area path data Error.pls check data table,area_id=%d",area_id);
+		  continue;
 		}
 		vp.emplace_back(atof(vs1[0].c_str()),atof(vs1[1].c_str()));
 	}