aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJordan <me@jordan.im>2022-02-25 17:30:06 -0700
committerJordan <me@jordan.im>2022-02-25 17:30:06 -0700
commit53323a42e1037dfb6c55ae396c53996ea5606ed9 (patch)
tree22f7b2c0d0580a0414342e6d8748ca8a84006ca0
parent92c560e4e8ba5bc90b4d99d324862c86f9a8e691 (diff)
downloadcrane-53323a42e1037dfb6c55ae396c53996ea5606ed9.tar.gz
crane-53323a42e1037dfb6c55ae396c53996ea5606ed9.zip
util.go: patch nil pointer dereference
-rw-r--r--util.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/util.go b/util.go
index 5d5de44..0843cca 100644
--- a/util.go
+++ b/util.go
@@ -293,7 +293,7 @@ func getPaper(client *http.Client, u string) (string, error) {
}
f(doc)
- if dl.String() == "" {
+ if dl == nil || dl.String() == "" {
return "", fmt.Errorf("%q: could not locate PDF direct link", u)
}