Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,15 @@ public enum S7BlockAtributes: byte
/// </summary>
public static bool HasTimestampConflict(DateTime dt1, DateTime dt2)
{
// A MinValue timestamp means the corresponding record (offline plaintext or
// online MC7) was never present, so there is nothing to compare and no
// conflict to flag. Without this guard, a block that only has one of the
// two interface records reports a spurious conflict against MinValue.
if (dt1 == DateTime.MinValue || dt2 == DateTime.MinValue)
{
return false;
}

if (!dt1.Equals(dt2))
{
return true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,13 @@ public IDataRow Structure

if ((!checkIFaceConflict && StructureFromString != null) || (checkIFaceConflict && !HasTimestampConflict(LastInterfaceChange, LastInterfaceChangeHistory)))
{
return StructureFromString;
return StructureFromString ?? StructureFromMC7;
}

return StructureFromMC7;
// Fall back to the other source if the preferred one is missing — for
// example a DB whose SUBBLKTYP 10 record has an empty SSBPART (no MC7
// interface) yet the timestamps disagree.
return StructureFromMC7 ?? StructureFromString;
}
set
{
Expand Down
Loading