From 588eadf62191c4def7ee7afc7083483dfb308344 Mon Sep 17 00:00:00 2001 From: IThundxr Date: Sat, 15 Jun 2024 11:28:04 -0400 Subject: [PATCH] add a analyzer for farmers delight --- src/logIssueAnalyzers/_logIssueAnalyzers.ts | 3 ++- src/logIssueAnalyzers/farmersDelightNPE.ts | 15 +++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 src/logIssueAnalyzers/farmersDelightNPE.ts diff --git a/src/logIssueAnalyzers/_logIssueAnalyzers.ts b/src/logIssueAnalyzers/_logIssueAnalyzers.ts index 99c83b2..3fdac70 100644 --- a/src/logIssueAnalyzers/_logIssueAnalyzers.ts +++ b/src/logIssueAnalyzers/_logIssueAnalyzers.ts @@ -1,6 +1,7 @@ import { Analyzer } from '../handlers/log.handler'; import { createVersionAnalyzer } from './createVersion'; +import { farmersDelightNPE } from './farmersDelightNPE'; -export const logAnalyzers: Analyzer[] = [createVersionAnalyzer]; +export const logAnalyzers: Analyzer[] = [createVersionAnalyzer, farmersDelightNPE]; export default logAnalyzers; diff --git a/src/logIssueAnalyzers/farmersDelightNPE.ts b/src/logIssueAnalyzers/farmersDelightNPE.ts new file mode 100644 index 0000000..2108822 --- /dev/null +++ b/src/logIssueAnalyzers/farmersDelightNPE.ts @@ -0,0 +1,15 @@ +import { Analyzer } from '../handlers/log.handler'; + +export const farmersDelightNPE: Analyzer = async (log) => { + if (!log.mods) return null; + + const regex = log.content.match(/NullPointerException.*class_2960.*farmersdelight\$migrateGet/gs) + if (regex) { + return { + name: 'Farmers Delight Missing Null check', + value: "Farmers Delight is missing a null check, update farmers delight", + }; + } + + return null; +};