check for nil

pull/362/head
Darien Raymond 8 years ago
parent f7e1f00c88
commit 07866e6d39
No known key found for this signature in database
GPG Key ID: 7251FFA14BB18169

@ -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

Loading…
Cancel
Save