Skip to content

Commit 9dc1cb4

Browse files
committed
Safety check.
1 parent 0d38f0b commit 9dc1cb4

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

xivModdingFramework/SqPack/DataContainers/IndexFile.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,11 @@ public IndexFile(XivDataFile dataFile, BinaryReader index1Stream, BinaryReader i
9898

9999
public void Save(BinaryWriter index1Stream, BinaryWriter index2Stream, bool disposeStreams = false)
100100
{
101+
if (ReadOnlyMode) throw new InvalidDataException("Index Files loaded in Read Only Mode cannot be saved to file.");
102+
101103
WriteIndex1File(index1Stream);
102104
WriteIndex2File(index2Stream);
105+
103106
if (disposeStreams)
104107
{
105108
index1Stream.Dispose();

0 commit comments

Comments
 (0)