summaryrefslogtreecommitdiff
path: root/bucket-lines/main.go
diff options
context:
space:
mode:
authorNick White <git@njw.name>2019-10-23 10:29:29 +0100
committerNick White <git@njw.name>2019-10-23 10:29:29 +0100
commit8b5c87c6d4e9ed8e220a4f8732c0cd48e92c7a09 (patch)
tree769c2ba323f85558bb6b1ebe9f607daa34231933 /bucket-lines/main.go
parent69aae6b93dcadd9e4895f86fe661ee80e79dcf9e (diff)
Make bucket-lines and related packages more robust
bucket-lines would crash for any line that didn't have a corresponding image. Lines which weren't grayscale would also cause crashes; now they are just converted to grayscale if necessary. As a bonus, lines in jpeg can also be decoded successfull.
Diffstat (limited to 'bucket-lines/main.go')
-rw-r--r--bucket-lines/main.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/bucket-lines/main.go b/bucket-lines/main.go
index 6ae506a..af81b44 100644
--- a/bucket-lines/main.go
+++ b/bucket-lines/main.go
@@ -74,7 +74,9 @@ func main() {
}
for _, l := range newlines {
- lines = append(lines, l)
+ if l.Img != nil {
+ lines = append(lines, l)
+ }
}
}