diff --git a/core/DataTable.php b/core/DataTable.php
index c7435b2b3cc3ba55c677145cd2a8c045d7ffcbf3..895645af0fbcb0626a4c48d5e7f7ae9cf27c6b7b 100644
--- a/core/DataTable.php
+++ b/core/DataTable.php
@@ -1118,6 +1118,8 @@ class DataTable implements DataTableInterface, \IteratorAggregate, \ArrayAccess
                 $depth++;
                 $aSerializedDataTable = $aSerializedDataTable + $subTable->getSerialized($maximumRowsInSubDataTable, $maximumRowsInSubDataTable, $columnToSortByBeforeTruncation);
                 $depth--;
+            } else {
+                $row->removeSubtable();
             }
         }
         // we load the current Id of the DataTable