Skip to content

Commit 8deac1b

Browse files
sudhirvermajrichter1
authored andcommitted
Fix 'getParent' of undefined
1 parent 021c3af commit 8deac1b

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/openshift/component.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -161,9 +161,7 @@ export class Component extends OpenShiftItem {
161161
'Select a Project',
162162
'Select an Application',
163163
'Select a Component you want to watch');
164-
const app: OpenShiftObject = component.getParent();
165-
const project: OpenShiftObject = app.getParent();
166-
Component.odo.executeInTerminal(Command.watchComponent(project.getName(), app.getName(), component.getName()));
164+
if (component) Component.odo.executeInTerminal(Command.watchComponent(component.getParent().getParent().getName(), component.getParent().getName(), component.getName()));
167165
}
168166

169167
static async openUrl(context: OpenShiftObject): Promise<ChildProcess> {

0 commit comments

Comments
 (0)