From f51e08d9ebb4f25780ea2eacb2ccc270202e4c55 Mon Sep 17 00:00:00 2001 From: glacambre Date: Wed, 10 Oct 2018 16:21:33 +0200 Subject: [PATCH] commandline_frame.ts: Fix exception thrown because of 'tri' not existing The commandline_frame document does not have a window.tri object. This makes the commandline throw an exception on page load. We fix this by using 'window.tri || {}' in order to avoid to avoid issues should 'window.tri' be defined in the command line one day. --- src/commandline_frame.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/commandline_frame.ts b/src/commandline_frame.ts index 5ef2227a..d1dfb8d0 100644 --- a/src/commandline_frame.ts +++ b/src/commandline_frame.ts @@ -399,6 +399,6 @@ Messaging.addListener("commandline_frame", Messaging.attributeCaller(SELF)) // object since there's apparently a bug that causes performance // observers to be GC'd even if they're still the target of a // callback. -;(window as any).tri = Object.assign(window.tri, { +;(window as any).tri = Object.assign(window.tri || {}, { perfObserver: perf.listenForCounters(), })