undo fix for newly created tags

This commit is contained in:
Jindra Petřík
2015-05-25 06:17:56 +02:00
parent 472002ca1c
commit 97c33e9319

View File

@@ -420,6 +420,9 @@ public abstract class Tag implements NeedsCharacters, Exportable, Serializable {
public void undo() throws InterruptedException, IOException {
byte[] data = getOriginalData();
if (data == null) { //If the tag is newly created in GUI it has no original data
return;
}
SWFInputStream tagDataStream = new SWFInputStream(swf, data, getDataPos(), data.length);
readData(tagDataStream, getOriginalRange(), 0, false, true, false);
setModified(false);