Commit 5a815076 authored by Mikael Salson's avatar Mikael Salson

WindowsStorage: getGermline returns NULL if the window doesn't exist

parent 1211e00f
......@@ -23,7 +23,10 @@ string WindowsStorage::getLabel(junction window) {
}
Germline *WindowsStorage::getGermline(junction window) {
return germline_by_window[window];
map<junction, Germline *>::iterator result = germline_by_window.find(window);
if (result == germline_by_window.end())
return NULL;
return result->second;
}
JsonList WindowsStorage::statusToJson(junction window) {
......
......@@ -39,6 +39,10 @@ class WindowsStorage {
*/
WindowsStorage(map<string, string> &labels);
/**
* @return a pointer to the germline of the window
* or NULL if the window doesn't exist.
*/
Germline *getGermline(junction window);
JsonList statusToJson(junction window);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment