Don't crash if recentfiles line fails to deserialize

This commit is contained in:
Ilari Liusvaara 2014-02-25 03:59:00 +02:00
parent 960fd4f892
commit defb1cba72

View file

@ -185,7 +185,12 @@ template<class T> void set<T>::add(const T& file)
std::string f;
while(in) {
std::getline(in, f);
T g = T::deserialize(f);
T g;
try {
g = T::deserialize(f);
} catch(...) {
continue;
}
if(g.check())
ents.push_back(g);
}
@ -233,7 +238,12 @@ template<class T> std::list<T> set<T>::get()
std::string f;
while(in) {
std::getline(in, f);
T g = T::deserialize(f);
T g;
try {
g = T::deserialize(f);
} catch(...) {
continue;
}
if(c < maxcount && g.check()) {
ents.push_back(g);
c++;
@ -260,4 +270,4 @@ void _dummy_63263632747434353545()
eat_argument(&set<multirom>::remove_hook);
eat_argument(&set<multirom>::get);
}
}
}