Skip to content

Commit 08910eb

Browse files
Update Partitioning.cpp to avoid empty partitions
1 parent 3a80cc5 commit 08910eb

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/Partitioning.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,8 +162,9 @@ std::vector<Partition> Partitioning::readPartitions(BlockDeviceType * blockDevic
162162
*/
163163
partition.size = (entry.lbaSize * 4096) >> 10;
164164

165-
if (entry.type == emptyPartitionType && partition.size != 0) {
165+
if (entry.type == emptyPartitionType || partition.size == 0) {
166166
// Skip empty partitions
167+
Arduino_UnifiedStorage::debugPrint("[Partitioning][readPartitions][INFO] Partition " + String(partitionIndex) + " is empty, skipping");
167168
continue;
168169
}
169170

0 commit comments

Comments
 (0)