diff --git a/random.gd b/random.gd index a0a37a0..2e9b2cb 100644 --- a/random.gd +++ b/random.gd @@ -13,6 +13,8 @@ static var rng: RandomNumberGenerator = null: static func sample(array: Array[Variant], imin = null, imax = null) -> Variant: + if len(array) == 0: + return null if imin == null: imin = 0 if imax == null: