Skip to content

Commit 028fc8c

Browse files
committed
Null DateTime
Handle NULL DateTime correctly to remove misleading information in the CSV
1 parent d618735 commit 028fc8c

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

‎NotepadStateLibrary/NotepadStateLibrary/NPTabState.cs‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ public string ContentString
101101
/// <summary>
102102
/// Modified Time of Saved File
103103
/// </summary>
104-
public DateTime Timestamp { get; private set; }
104+
public DateTime? Timestamp { get; private set; }
105105
/// <summary>
106106
/// <para>0 = Unsaved Tab</para>
107107
/// <para>1 = Saved Tab</para>
@@ -554,8 +554,10 @@ private void Save() //TODO: Expose this?
554554
writer.Write(CarriageReturnType);
555555
c.AddBytes(CarriageReturnType);
556556

557-
writer.Write(((ulong)Timestamp.ToFileTime()).WriteLEB128Unsigned());
558-
c.AddBytes((ulong)Timestamp.ToFileTime());
557+
DateTime dt = (DateTime)Timestamp;
558+
559+
writer.Write(((ulong)dt.ToFileTime()).WriteLEB128Unsigned());
560+
c.AddBytes((ulong)dt.ToFileTime());
559561

560562
writer.Write(FileHashStored);
561563
c.AddBytes(FileHashStored);

0 commit comments

Comments
 (0)