diff --git a/changelog/unreleased/issue-3296 b/changelog/unreleased/issue-3296
new file mode 100644
index 000000000..1e98c30e0
--- /dev/null
+++ b/changelog/unreleased/issue-3296
@@ -0,0 +1,7 @@
+Bugfix: Fix crash of `check --read-data-subset=x%` run for an empty repository
+
+`check --read-data-subset=x%` crashed when run for an empty repository. This
+has been fixed.
+
+https://github.com/restic/restic/issues/3296
+https://github.com/restic/restic/pull/3309
diff --git a/cmd/restic/cmd_check.go b/cmd/restic/cmd_check.go
index 859e16580..2b5017ead 100644
--- a/cmd/restic/cmd_check.go
+++ b/cmd/restic/cmd_check.go
@@ -331,7 +331,7 @@ func selectPacksByBucket(allPacks map[restic.ID]int64, bucket, totalBuckets uint
 func selectRandomPacksByPercentage(allPacks map[restic.ID]int64, percentage float64) map[restic.ID]int64 {
 	packCount := len(allPacks)
 	packsToCheck := int(float64(packCount) * (percentage / 100.0))
-	if packsToCheck < 1 {
+	if packCount > 0 && packsToCheck < 1 {
 		packsToCheck = 1
 	}
 	timeNs := time.Now().UnixNano()
diff --git a/cmd/restic/cmd_check_test.go b/cmd/restic/cmd_check_test.go
index 929771151..ef038c050 100644
--- a/cmd/restic/cmd_check_test.go
+++ b/cmd/restic/cmd_check_test.go
@@ -122,3 +122,10 @@ func TestSelectRandomPacksByPercentage(t *testing.T) {
 		rtest.Assert(t, ok, "Expected input and output to be equal")
 	}
 }
+
+func TestSelectNoRandomPacksByPercentage(t *testing.T) {
+	// that the a repository without pack files works
+	var testPacks = make(map[restic.ID]int64)
+	selectedPacks := selectRandomPacksByPercentage(testPacks, 10.0)
+	rtest.Assert(t, len(selectedPacks) == 0, "Expected 0 selected packs")
+}