Check if there is any author before using the first

- Closes: #26
This commit is contained in:
Las Zenow 2017-02-05 14:14:22 +00:00
parent ffbca5e162
commit 6464d92dd4
3 changed files with 19 additions and 3 deletions

View file

@ -157,7 +157,13 @@ func readHandler(h handler) {
var data readData
data.S = GetStatus(h)
data.S.Title = book.Title + " by " + book.Author[0] + " -- Read -- " + data.S.Title
author := ""
if len(book.Author) > 0 {
author = " by " + book.Author[0]
}
data.S.Title = book.Title + author + " -- Read -- " + data.S.Title
data.Book = book
if !book.Active {
data.Back = "/new/"