From 99f716ceb58b72016a7828d6956a1160e4346737 Mon Sep 17 00:00:00 2001
From: Nick White <git@njw.name>
Date: Fri, 27 Sep 2019 18:12:54 +0100
Subject: Fix crash bug when graph was used on source with less than 10 pages

---
 bookpipeline/graph.go | 3 +++
 1 file changed, 3 insertions(+)

(limited to 'bookpipeline')

diff --git a/bookpipeline/graph.go b/bookpipeline/graph.go
index acd015e..955abbd 100644
--- a/bookpipeline/graph.go
+++ b/bookpipeline/graph.go
@@ -66,6 +66,9 @@ func Graph(confs map[string]*Conf, bookname string, w io.Writer) error {
 	var annotations []chart.Value2
 	var ticks []chart.Tick
 	tickevery := len(graphconf) / maxticks
+	if tickevery < 1 {
+		tickevery = 1
+	}
 	for i, c := range graphconf {
 		xvalues = append(xvalues, c.Pgnum)
 		yvalues = append(yvalues, c.Conf)
-- 
cgit v1.2.1-24-ge1ad