Fix issue where GitLab support would break if GitHub wasn't also configured (#362)

* Drop !github

* changelog
This commit is contained in:
Will Hunt 2022-05-23 15:34:25 +01:00 committed by GitHub
parent 0241a90e9d
commit 2a9326a499
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 2 deletions

1
changelog.d/362.bugfix Normal file
View File

@ -0,0 +1 @@
Fixed an issue that prevented GitLab repo connections from working if GitHub support is disabled.

View File

@ -155,8 +155,8 @@ export class GitLabRepoConnection extends CommandConnection {
throw new ValidatorApiError(validator.errors);
}
static async createConnectionForState(roomId: string, event: StateEvent<Record<string, unknown>>, {as, tokenStore, github, config}: InstantiateConnectionOpts) {
if (!github || !config.gitlab) {
static async createConnectionForState(roomId: string, event: StateEvent<Record<string, unknown>>, {as, tokenStore, config}: InstantiateConnectionOpts) {
if (!config.gitlab) {
throw Error('GitLab is not configured');
}
const state = this.validateState(event.content, true);