Fix packet data being trashed by Restore Replay GUI (fixes #129)

This commit is contained in:
Jonas Herzig
2018-12-17 14:42:03 +01:00
parent d791eedae9
commit c94f5d17f4

View File

@@ -43,6 +43,9 @@ public class RestoreReplayGui extends AbstractGuiScreen<RestoreReplayGui> {
yesButton.onClick(() -> {
try {
ReplayFile replayFile = new ZipReplayFile(new ReplayStudio(), null, file);
// Commit all not-yet-committed files into the main zip file.
// If we don't do this, then re-writing packet data below can actually overwrite uncommitted packet data!
replayFile.save();
ReplayMetaData metaData = replayFile.getMetaData();
if (metaData != null && metaData.getDuration() == 0) {
// Try to restore replay duration