mirror of
https://github.com/EvolutionAPI/evolution-api.git
synced 2025-07-14 09:51:24 -06:00
fix: Fixed error 500 when logout in instance with status = close
This commit is contained in:
parent
bb4490307d
commit
01d4a95d2d
@ -401,6 +401,12 @@ export class InstanceController {
|
|||||||
|
|
||||||
public async logout({ instanceName }: InstanceDto) {
|
public async logout({ instanceName }: InstanceDto) {
|
||||||
this.logger.verbose('requested logout from ' + instanceName + ' instance');
|
this.logger.verbose('requested logout from ' + instanceName + ' instance');
|
||||||
|
const stateConn = await this.connectionState({ instanceName });
|
||||||
|
|
||||||
|
if (stateConn.state === 'close') {
|
||||||
|
throw new BadRequestException('Instance already logged out');
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
this.logger.verbose('logging out instance: ' + instanceName);
|
this.logger.verbose('logging out instance: ' + instanceName);
|
||||||
await this.waMonitor.waInstances[instanceName]?.client?.logout(
|
await this.waMonitor.waInstances[instanceName]?.client?.logout(
|
||||||
|
Loading…
Reference in New Issue
Block a user