Guard getColors call when function missing

This commit is contained in:
Rodrigo Rodriguez (Pragmatismo) 2025-09-24 18:05:36 -03:00
parent 46b65779cb
commit 5244e1faea

View file

@ -1203,10 +1203,11 @@ export class KBService implements IGBKBService {
page = await this.getFreshPage(browser, website); page = await this.getFreshPage(browser, website);
await page.screenshot({ path: 'screenshot.png' }); await page.screenshot({ path: 'screenshot.png' });
const colors = await getColors('screenshot.png'); if (getColors) {
await min.core['setConfig'](min, 'Color1', colors[0].hex()); const colors = await getColors('screenshot.png');
await min.core['setConfig'](min, 'Color2', colors[1].hex()); await min.core['setConfig'](min, 'Color1', colors[0].hex());
await min.core['setConfig'](min, 'Color2', colors[1].hex());
}
// Disables images in crawling. // Disables images in crawling.
await page.setRequestInterception(true); await page.setRequestInterception(true);