Skip to content

Commit 198d465

Browse files
committed
Use explicit nil checks for shard variables
1 parent c47b44b commit 198d465

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

test/collections_test_helper.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ def shard_collections(all_collections)
6161
shard = ENV["COLLECTION_SHARD"]&.to_i
6262
total_shards = ENV["COLLECTION_TOTAL_SHARDS"]&.to_i
6363

64-
return all_collections unless shard && total_shards && total_shards > 1
64+
return all_collections unless !shard.nil? && !total_shards.nil? && total_shards > 1
6565

6666
# Sort alphabetically for deterministic sharding
6767
sorted = all_collections.sort

0 commit comments

Comments
 (0)