Skip to content

Commit

Permalink
fix(queue-service): use toString to better check for object
Browse files Browse the repository at this point in the history
  • Loading branch information
raschan committed Sep 8, 2021
1 parent 8fdce3c commit d825139
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/service/queue/queue.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ export class QueueService {
public async send<T>(target: string, message: T, sendOptions?: SendOptions | string, connectionName?: string): Promise<SendState> {
const connection =
connectionName ?? (typeof sendOptions === 'string' ? (sendOptions as string) : (AMQP_DEFAULT_CONNECTION_TOKEN as string));
const options = typeof sendOptions === 'object' ? sendOptions : {};
const options = toString.call(sendOptions) === '[object Object]' ? (sendOptions as SendOptions) : {};

// get sender
const sender: AwaitableSender = await this.getSender(target, connection);
Expand Down

0 comments on commit d825139

Please sign in to comment.