From 82b55693b24b988c79fc42ce36b979e69434f892 Mon Sep 17 00:00:00 2001 From: Avril Date: Sun, 21 Apr 2019 11:42:35 +0100 Subject: [PATCH] fixed? --- loli.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/loli.js b/loli.js index 6d669a1..e013428 100644 --- a/loli.js +++ b/loli.js @@ -105,9 +105,9 @@ exports.defaultConfig = cfg; exports.Config = Config; function randomise(cb, conf) { - if(conf) - var cfg = conf; - cfg.debug("Calling with params "+JSON.stringify(cfg)); - randomiseWith(cfg.debug, cfg.number, cfg.range, cfg.page, cfg.tags, cb); + if(!conf) + return randomise(cb, cfg); + conf.debug("Calling with params "+JSON.stringify(conf)); + randomiseWith(conf.debug, conf.number, conf.range, conf.page, conf.tags, cb); } exports.randomise = randomise;