]> git.lyx.org Git - features.git/commitdiff
Gracefully return a value if an invalid author is requested
authorVincent van Ravesteijn <vfr@lyx.org>
Mon, 10 Mar 2014 19:02:29 +0000 (20:02 +0100)
committerVincent van Ravesteijn <vfr@lyx.org>
Mon, 10 Mar 2014 19:02:57 +0000 (20:02 +0100)
src/Author.cpp

index 6c608327e135c0d2e12ecc25569a2059af2ac640..d4061c64eaa1a879e50254aef89fd4646969bd81 100644 (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];
 }