From 0bd907b7b830485d1768ce8e86b170b3da73af94 Mon Sep 17 00:00:00 2001 From: Vincent van Ravesteijn Date: Mon, 10 Mar 2014 20:02:29 +0100 Subject: [PATCH] Gracefully return a value if an invalid author is requested --- src/Author.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Author.cpp b/src/Author.cpp index 6c608327e1..d4061c64ea 100644 --- a/src/Author.cpp +++ b/src/Author.cpp @@ -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]; } -- 2.39.5