From e81e98e6a99ef683c6287da2a28f67fd027947d4 Mon Sep 17 00:00:00 2001 From: Georgy Buranov Date: Mon, 28 Mar 2016 00:45:00 +0200 Subject: [PATCH] check options for nil Fixes #318 --- github/search.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/github/search.go b/github/search.go index d9e9b41..073b6c0 100644 --- a/github/search.go +++ b/github/search.go @@ -148,7 +148,7 @@ func (s *SearchService) search(searchType string, query string, opt *SearchOptio return nil, err } - if opt.TextMatch { + if opt != nil && opt.TextMatch { // Accept header defaults to "application/vnd.github.v3+json" // We change it here to fetch back text-match metadata req.Header.Set("Accept", "application/vnd.github.v3.text-match+json")