Unexpected invalid memory address or nil pointer dereference
<p>I'm getting a runtime error for an invalid memory address.</p>

<pre><code>panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x10 pc=0x4e0f24]

goroutine 1192592 [running]:
panic(0x793540, 0xc420010040)
#011/usr/local/go/src/runtime/panic.go:500 +0x1a1
foobar/sd.(*Channel).Attributes(0x0, 0xc420110101, 0xc42278f9b0, 0x9)
#011/home/app/go/src/foobar/sd/channel.go:36 +0x54
</code></pre>

<p>channel.go looks like this:</p>

<pre><code>35 func (m *Channel) Attributes() (*ChannelAttrs, error) {
36    redisHash := "sd:channels:" + m.hash
37
38    rc := m.ctx.RedisPool.Get()
39    values, err := redis.Values(rc.Do("HGETALL", redisHash))
40    rc.Close()
41    if err != nil {
42        return nil, err
43    }
44    attrs := ChannelAttrs{}
45    redis.ScanStruct(values, &amp;attrs)
46    return &amp;attrs, nil
47 }
</code></pre>

<p>How is it possible that the line 36 is causing this? Is it somehow possible for <code>m</code> to be nil? If so, how?</p>

<p>Note: hash is defined as string</p>