From 4bf024b795e6ea24e15c63906b59b9f4df20cdf2 Mon Sep 17 00:00:00 2001 From: lnedry Date: Sat, 11 May 2024 19:34:31 -0400 Subject: [PATCH] Confirm maxmind database has loaded before registering hook. (#23) --- index.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index c9209c5..e25f317 100644 --- a/index.js +++ b/index.js @@ -294,8 +294,9 @@ exports.test_and_register_geoip = async function () { try { this.maxmind = require('maxmind'); - await this.load_dbs() - this.register_hook('connect', 'lookup_via_maxmind'); + if (await this.load_dbs()) { + this.register_hook('connect', 'lookup_via_maxmind'); + } } catch (e) { this.logerror(e);