commit 8c17b4917ad8360f27341392c348a935ea38823f
parent 6dd1d05813936751d052d9db73322a2517c3db54
Author: cfillion <cfillion@users.noreply.github.com>
Date: Fri, 1 Jan 2016 20:03:00 -0800
don't crash when marking nonexistent remotes
Diffstat:
1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/src/manager.cpp b/src/manager.cpp
@@ -118,9 +118,15 @@ void Manager::markFor(const Action action)
if(index < 0)
return;
- const string &remoteName = from_autostring(m_list->getRow(index)[0]);
- const Remote remote =
- {"aaaaaaa", m_reapack->config()->remotes().at(remoteName)};
+ const string remoteName = from_autostring(m_list->getRow(index)[0]);
+
+ const RemoteMap &remotes = m_reapack->config()->remotes();
+ const auto it = remotes.find(remoteName);
+
+ if(it == remotes.end())
+ return;
+
+ const Remote remote = {"aaaaaaa", it->second};
MessageBox(handle(), to_autostring(action).c_str(),
m_list->getRow(index)[0].c_str(), MB_OK);