From 082bc3a7ceafbe8e4d63eb6c31d970192ad52af2 Mon Sep 17 00:00:00 2001 From: mbergen Date: Thu, 7 Nov 2024 09:33:29 +0100 Subject: [PATCH] feat(transfer): throw error in case of missing team template (#5009) * feat(transfer) Error on missing team template * Update transfer_row.lua * Apply suggestions from code review linter --------- Co-authored-by: hjpalpha <75081997+hjpalpha@users.noreply.github.com> --- components/transfer/commons/transfer_row.lua | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/components/transfer/commons/transfer_row.lua b/components/transfer/commons/transfer_row.lua index 957a4544d37..2909450ebd0 100644 --- a/components/transfer/commons/transfer_row.lua +++ b/components/transfer/commons/transfer_row.lua @@ -113,6 +113,12 @@ function TransferRow:_readBaseData() local toTeam = Array.map({args.team2 or '', args.team2_2 or ''}, FnUtil.curry(checkTeam, date)) local fromTeam = Array.map({args.team1 or '', args.team1_2 or ''}, FnUtil.curry(checkTeam, fromDate)) + if Logic.isDeepEmpty(fromTeam) and String.isNotEmpty(args.team1) then + error('Missing team template for team ' .. args.team1) + end + if Logic.isDeepEmpty(toTeam) and String.isNotEmpty(args.team2) then + error('Missing team template for team ' .. args.team2) + end ---@param str string? ---@return string? local ucFirst = function(str)