mirror of
https://github.com/v2fly/v2ray-core.git
synced 2025-01-02 23:47:07 -05:00
check for nil
This commit is contained in:
parent
f7e1f00c88
commit
07866e6d39
@ -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…
Reference in New Issue
Block a user