@@ -33,17 +33,16 @@ func (h *Task) Load() {
3333
3434// Application returns the application associated with the task.
3535func (h * Task ) Application () (r * api.Application , err error ) {
36- appRef := h .task .Application
37- if appRef == nil {
38- err = & NotFound {}
39- return
36+ ref := h .task .Application
37+ if ref == nil {
38+ ref = & api.Ref {}
4039 }
41- r , err = h .richClient .Application .Get (appRef .ID )
40+ r , err = h .richClient .Application .Get (ref .ID )
4241 if err != nil {
4342 return
4443 }
4544 r .Identities = []api.Ref {}
46- identities , err := h .richClient .Application .Identity (appRef .ID ).List ()
45+ identities , err := h .richClient .Application .Identity (ref .ID ).List ()
4746 if err != nil {
4847 return
4948 }
@@ -60,12 +59,11 @@ func (h *Task) Application() (r *api.Application, err error) {
6059
6160// Platform returns the platform associated with the task.
6261func (h * Task ) Platform () (r * api.Platform , err error ) {
63- appRef := h .task .Platform
64- if appRef == nil {
65- err = & NotFound {}
66- return
62+ ref := h .task .Platform
63+ if ref == nil {
64+ ref = & api.Ref {}
6765 }
68- r , err = h .richClient .Platform .Get (appRef .ID )
66+ r , err = h .richClient .Platform .Get (ref .ID )
6967 return
7068}
7169
@@ -74,10 +72,6 @@ func (h *Task) Platform() (r *api.Platform, err error) {
7472// inject: perform injection.
7573func (h * Task ) Addon (inject bool ) (r * api.Addon , err error ) {
7674 name := h .task .Addon
77- if name == "" {
78- err = & NotFound {}
79- return
80- }
8175 r , err = h .richClient .Addon .Get (name )
8276 if err != nil {
8377 return
0 commit comments