mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
A null header from features is an error
This commit is contained in:
@@ -1756,7 +1756,8 @@ Some special strings that can be used:
|
||||
/// <summary>
|
||||
/// Pre-configured DatHeader
|
||||
/// </summary>
|
||||
protected DatHeader Header { get; set; }
|
||||
/// <remarks>Public because it's an indicator something went wrong</remarks>
|
||||
public DatHeader Header { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Lowest log level for output
|
||||
@@ -2140,11 +2141,20 @@ Some special strings that can be used:
|
||||
foreach (string ot in GetList(features, OutputTypeListValue))
|
||||
{
|
||||
DatFormat dftemp = GetDatFormat(ot);
|
||||
if (dftemp == DatFormat.Logiqx && deprecated)
|
||||
if (dftemp == 0x00)
|
||||
{
|
||||
logger.Error($"{ot} is not a recognized DAT format");
|
||||
return null;
|
||||
}
|
||||
else if (dftemp == DatFormat.Logiqx && deprecated)
|
||||
{
|
||||
datHeader.DatFormat |= DatFormat.LogiqxDeprecated;
|
||||
}
|
||||
else
|
||||
{
|
||||
datHeader.DatFormat |= dftemp;
|
||||
}
|
||||
}
|
||||
|
||||
return datHeader;
|
||||
}
|
||||
@@ -2207,7 +2217,6 @@ Some special strings that can be used:
|
||||
return remover;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Get Splitter from feature list
|
||||
/// </summary>
|
||||
|
||||
@@ -126,7 +126,7 @@ namespace SabreTools
|
||||
case Stats.Value:
|
||||
case Update.Value:
|
||||
case Verify.Value:
|
||||
VerifyInputs(feature.Inputs, featureName);
|
||||
VerifyInputs(feature.Inputs, feature);
|
||||
feature.ProcessFeatures(features);
|
||||
break;
|
||||
|
||||
@@ -185,12 +185,19 @@ namespace SabreTools
|
||||
/// </summary>
|
||||
/// <param name="inputs">List of inputs</param>
|
||||
/// <param name="feature">Name of the current feature</param>
|
||||
private static void VerifyInputs(List<string> inputs, string feature)
|
||||
private static void VerifyInputs(List<string> inputs, BaseFeature feature)
|
||||
{
|
||||
if (inputs.Count == 0)
|
||||
{
|
||||
logger.Error("This feature requires at least one input");
|
||||
_help.OutputIndividualFeature(feature);
|
||||
_help.OutputIndividualFeature(feature.Name);
|
||||
Environment.Exit(0);
|
||||
}
|
||||
|
||||
if (feature.Header == null)
|
||||
{
|
||||
logger.Error("Please check for errors in parameters");
|
||||
_help.OutputIndividualFeature(feature.Name);
|
||||
Environment.Exit(0);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user