-
Christian Muirhead authored
Methods that return interfaces shouldn't implicitly return nil values, they should return nil explicitly. Otherwise the result is a typed nil, which will compare != nil but still trigger a nil reference panic if any methods are called on it. https://golang.org/doc/faq#nil_error (About errors, but applies to any interface.) https://bugs.launchpad.net/juju-core/+bug/1573659 This crash was caused by a typed nil link - the line immediately before the panic checked for a nil, but because the type pointer is set on the Link it wasn't equal to nil.
3cdbf7ef