Skip to content

Commit 8e7ea5f

Browse files
committed
checkpoint
Signed-off-by: Jeff Ortel <[email protected]>
1 parent fac5a7f commit 8e7ea5f

File tree

1 file changed

+9
-15
lines changed

1 file changed

+9
-15
lines changed

addon/task.go

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -33,17 +33,16 @@ func (h *Task) Load() {
3333

3434
// Application returns the application associated with the task.
3535
func (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.
6261
func (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.
7573
func (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

Comments
 (0)