Browse Source

re set new attack id on message records

Julien Clauter 9 years ago
parent
commit
7c17844572
1 changed files with 6 additions and 6 deletions
  1. 6 6
      src/de/tudarmstadt/informatik/hostage/logging/SyncRecord.java

+ 6 - 6
src/de/tudarmstadt/informatik/hostage/logging/SyncRecord.java

@@ -97,12 +97,6 @@ public class SyncRecord implements Parcelable, Serializable {
         this.attackRecord = null;
         AttackRecord attack= this.getAttackRecord();
 
-        if (messageRecords != null){
-            for (MessageRecord messageRecord : this.messageRecords){
-                messageRecord.setAttack_id(attack.getAttack_id());
-            }
-        }
-
 
         //this.id = source.readInt();
         //this.timestamp = source.readLong();
@@ -153,6 +147,12 @@ public class SyncRecord implements Parcelable, Serializable {
             record.setRemoteIP(this.remoteIP);
             record.setRemotePort(this.remotePort);
             this.attackRecord = record;
+
+            if (messageRecords != null){
+                for (MessageRecord messageRecord : this.messageRecords){
+                    messageRecord.setAttack_id(record.getAttack_id());
+                }
+            }
         }
 
         return this.attackRecord;