Add some more corner tests for ReaderContains

This commit is contained in:
bep
2015-03-30 01:22:08 +02:00
parent be1429fa88
commit be21e2cbed
2 changed files with 6 additions and 2 deletions

View File

@@ -115,7 +115,7 @@ func BytesToReader(in []byte) io.Reader {
// ReaderContains reports whether subslice is within r.
func ReaderContains(r io.Reader, subslice []byte) bool {
if len(subslice) == 0 {
if r == nil || len(subslice) == 0 {
return false
}