Skip to content

Commit

Permalink
check for nil
Browse files Browse the repository at this point in the history
  • Loading branch information
DarienRaymond committed Jan 13, 2017
1 parent f7e1f00 commit 07866e6
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions app/space.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 07866e6

Please sign in to comment.