From 07866e6d3929832cde9ff769d32da85c060d9bbc Mon Sep 17 00:00:00 2001 From: Darien Raymond Date: Fri, 13 Jan 2017 14:33:28 +0100 Subject: [PATCH] check for nil --- app/space.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/space.go b/app/space.go index d3928282..9cc55842 100644 --- a/app/space.go +++ b/app/space.go @@ -72,11 +72,17 @@ func (v *spaceImpl) Initialize() error { } func (v *spaceImpl) GetApplication(appInterface interface{}) Application { + if v == nil { + return nil + } appType := reflect.TypeOf(appInterface) return v.cache[appType] } func (v *spaceImpl) AddApplication(app Application) error { + if v == nil { + return errors.New("App: Nil space.") + } appType := reflect.TypeOf(app.Interface()) v.cache[appType] = app return nil