Check input files exist, exit gracefully if they dont
This commit is contained in:
parent
56fbe22591
commit
3493f27b6f
@ -244,6 +244,11 @@ namespace AssortGenerator.Common.Helpers
|
||||
if (_questData == null)
|
||||
{
|
||||
var questFilePath = InputFileHelper.GetInputFilePaths().FirstOrDefault(x => x.Contains(filename));
|
||||
if (questFilePath == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
var questDataJson = File.ReadAllText(questFilePath);
|
||||
_questData = JsonSerializer.Deserialize<Dictionary<string, Quest>>(questDataJson);
|
||||
}
|
||||
@ -256,6 +261,11 @@ namespace AssortGenerator.Common.Helpers
|
||||
if (_liveQuestData == null)
|
||||
{
|
||||
var questFilePath = InputFileHelper.GetInputFilePaths().FirstOrDefault(x => x.Contains(filename));
|
||||
if (questFilePath == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
var questDataJson = File.ReadAllText(questFilePath);
|
||||
_liveQuestData = JsonSerializer.Deserialize<QuestRoot>(questDataJson);
|
||||
}
|
||||
|
@ -20,6 +20,12 @@ namespace QuestValidator
|
||||
var questData = QuestHelper.GetQuestData();
|
||||
var liveQuestData = QuestHelper.GetLiveQuestData();
|
||||
|
||||
if (questData == null || liveQuestData == null)
|
||||
{
|
||||
LoggingHelpers.LogError("Unable to read quest data. Are you sure the both quest files are in 'QuestValidator//bin//Debug//netcoreapp3.1//input'");
|
||||
return;
|
||||
}
|
||||
|
||||
CheckForMissingQuestsInAkiFile(liveQuestData, questData);
|
||||
|
||||
foreach (var item in questData)
|
||||
|
Loading…
x
Reference in New Issue
Block a user