Gracefully return a value if an invalid author is requested

This commit is contained in:
Vincent van Ravesteijn 2014-03-10 20:02:29 +01:00
parent aea5e80f45
commit 0bd907b7b8

View File

@ -118,8 +118,8 @@ void AuthorList::recordCurrentAuthor(Author const & a)
Author const & AuthorList::get(int id) const
{
// LASSERT: What should we do here?
LASSERT(id < (int)authors_.size() , /**/);
// authors_[0] is guaranteed to exist
LASSERT(id < (int)authors_.size() , return authors_[0]);
return authors_[id];
}