Fix appservice transactions throwing errors

We weren't awaiting the appservice, so the truthy check passes and we get "cannot read property id of undefined" in the REST handler.
This commit is contained in:
Travis Ralston 2018-03-24 12:20:20 -06:00
parent 51810cce8f
commit bebcfa1bba

View File

@ -26,7 +26,7 @@ export class AppserviceStore {
}
public static async getByHomeserverToken(hsToken: string): Promise<AppService> {
const appservice = AppService.findOne({where: {hsToken: hsToken}});
const appservice = await AppService.findOne({where: {hsToken: hsToken}});
if (!appservice) throw new Error("Appservice not found");
return appservice;
}