提交 0f6dc0b8 编写于 作者: A Aaron Xiao 提交者: Jiangtao Hu

Check mode existance.

上级 3bf26a78
......@@ -231,7 +231,8 @@ void HMIWorker::InitStatus() {
} else {
// Change to the last active mode, or else the first one in options.
const std::string cached_mode = KVDB::Get(FLAGS_current_mode_db_key);
ChangeMode(!cached_mode.empty() ? cached_mode : modes.begin()->first);
ChangeMode(
ContainsKey(modes, cached_mode) ? cached_mode : modes.begin()->first);
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册