From 9ab631b4c4c002a10c910b53d7fbf2579461bced Mon Sep 17 00:00:00 2001 From: Raymond Hill Date: Tue, 1 Sep 2020 09:53:35 -0400 Subject: [PATCH] Ensure port instance exists when waiting for connection requests --- platform/chromium/vapi-client-extra.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/platform/chromium/vapi-client-extra.js b/platform/chromium/vapi-client-extra.js index f18280e04..383678f84 100644 --- a/platform/chromium/vapi-client-extra.js +++ b/platform/chromium/vapi-client-extra.js @@ -151,8 +151,9 @@ vAPI.MessagingConnection = class { static addListener(listener) { listeners.add(listener); + vAPI.messaging.getPort(); // Ensure a port instance exists } - static async connectTo(from, to, handler) { + static connectTo(from, to, handler) { const port = vAPI.messaging.getPort(); if ( port === null ) { return; } const connection = new vAPI.MessagingConnection(handler, {