summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sift.go18
1 files changed, 10 insertions, 8 deletions
diff --git a/sift.go b/sift.go
index 284a8fa..fdd01fd 100644
--- a/sift.go
+++ b/sift.go
@@ -107,14 +107,16 @@ func main() {
}
}
- authorsMap := m["authors"].([]interface{})
- for i, author := range authorsMap {
- authorText := author.(string)
- if i > 0 {
- authors += " & "
- authors += authorText
- } else {
- authors = authorText
+ if m["authors"] != nil {
+ authorsMap := m["authors"].([]interface{})
+ for i, author := range authorsMap {
+ authorText := author.(string)
+ if i > 0 {
+ authors += " & "
+ authors += authorText
+ } else {
+ authors = authorText
+ }
}
}