Skip to content

Commit ceb45d8

Browse files
committed
code cleanup
Signed-off-by: Oleksii Orel <oorel@redhat.com>
1 parent c268c09 commit ceb45d8

5 files changed

Lines changed: 10 additions & 8 deletions

File tree

dashboard/src/app/admin/plugins/plugins.controller.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,9 @@ export class AdminPluginsCtrl {
5050
promise.then(() => {
5151
this.updateData();
5252
this.isLoading = false;
53-
},
54-
(error) => {
53+
}, (error: any) => {
5554
this.isLoading = false;
56-
if (error.status === 304) {
55+
if (error && error.status === 304) {
5756
this.updateData();
5857
}
5958
});

dashboard/src/app/stacks/stack-details/stack.controller.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ export class StackController {
197197
this.loading = false;
198198
this.prepareStackData();
199199
}, (error: any) => {
200-
if (error.status === 304) {
200+
if (error && error.status === 304) {
201201
this.loading = false;
202202
this.stack = this.cheStack.getStackById(this.stackId);
203203
this.prepareStackData();

dashboard/src/app/workspaces/list-workspaces/list-workspaces.controller.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ export class ListWorkspacesCtrl {
127127
promise.then(() => {
128128
return this.updateSharedWorkspaces();
129129
}, (error: any) => {
130-
if (error.status === 304) {
130+
if (error && error.status === 304) {
131131
// ok
132132
return this.updateSharedWorkspaces();
133133
}
@@ -232,6 +232,9 @@ export class ListWorkspacesCtrl {
232232
this.cheListHelper.itemsSelectionStatus[workspaceId] = false;
233233

234234
let workspace = this.cheWorkspace.getWorkspaceById(workspaceId);
235+
if (!workspace) {
236+
return;
237+
}
235238
workspaceName = workspace.config.name;
236239
let stoppedStatusPromise = this.cheWorkspace.fetchStatusChange(workspaceId, 'STOPPED');
237240

dashboard/src/app/workspaces/workspace-details/workspace-details.service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ export class WorkspaceDetailsService {
215215
return this.$q.when();
216216
}
217217

218-
const initStatus = oldWorkspace.status;
218+
const initStatus = oldWorkspace && oldWorkspace.status;
219219

220220
const oldConfig = angular.copy(oldWorkspace.config);
221221
delete oldConfig.projects;

dashboard/src/components/api/workspace/che-workspace.factory.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ export class CheWorkspace {
312312
});
313313
return this.workspaces;
314314
}, (error: any) => {
315-
if (error.status === 304) {
315+
if (error && error.status === 304) {
316316
return this.workspaces;
317317
}
318318
return this.$q.reject(error);
@@ -354,7 +354,7 @@ export class CheWorkspace {
354354
this.updateWorkspacesList(workspace);
355355
defer.resolve();
356356
}, (error: any) => {
357-
if (error.status === 304) {
357+
if (error && error.status === 304) {
358358
defer.resolve();
359359
return;
360360
}

0 commit comments

Comments
 (0)