Skip to content

Commit

Permalink
Widget crashes when there's no branch in the context #6969
Browse files Browse the repository at this point in the history
  • Loading branch information
alansemenov committed Oct 19, 2023
1 parent 0562d4d commit 37ffbdc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import {WidgetsSelectionRow} from './WidgetsSelectionRow';
import {VersionHistoryView} from './widget/version/VersionHistoryView';
import {DependenciesWidgetItemView} from './widget/dependency/DependenciesWidgetItemView';
import {StatusWidgetItemView} from './widget/details/StatusWidgetItemView';
import {PropertiesWidgetItemView} from './widget/details/PropertiesWidgetItemView';
import {AttachmentsWidgetItemView} from './widget/details/AttachmentsWidgetItemView';
import {PageTemplateWidgetItemView} from './widget/details/PageTemplateWidgetItemView';
import {GetWidgetsByInterfaceRequest} from '../../resource/GetWidgetsByInterfaceRequest';
Expand Down Expand Up @@ -445,8 +444,8 @@ export class ContextView
];
}

private fetchCustomWidgetViews(): Q.Promise<Widget[]> {
let getWidgetsByInterfaceRequest = new GetWidgetsByInterfaceRequest(this.getWidgetsInterfaceNames());
protected fetchCustomWidgetViews(): Q.Promise<Widget[]> {
const getWidgetsByInterfaceRequest = new GetWidgetsByInterfaceRequest(this.getWidgetsInterfaceNames());

return getWidgetsByInterfaceRequest.sendAndParse();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export class WidgetItemView
}

private static getFullWidgetUrl(url: string, contentId: string) {
const branch: string = CONFIG.getString('branch');
const branch: string = CONFIG.has('branch') ? CONFIG.getString('branch') : '';
const repository: string = `${RepositoryId.CONTENT_REPO_PREFIX}${ProjectContext.get().getProject().getName()}`;
const repositoryParam = `repository=${repository}&`;
const branchParam = branch ? `branch=${branch}&` : '';
Expand Down

0 comments on commit 37ffbdc

Please sign in to comment.