Don't crash if recentfiles line fails to deserialize
This commit is contained in:
parent
960fd4f892
commit
defb1cba72
1 changed files with 13 additions and 3 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue