diff options
Diffstat (limited to 'lisp/net/soap-inspect.el')
-rw-r--r-- | lisp/net/soap-inspect.el | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lisp/net/soap-inspect.el b/lisp/net/soap-inspect.el index b994b0ed862..5207ca8ff19 100644 --- a/lisp/net/soap-inspect.el +++ b/lisp/net/soap-inspect.el @@ -114,7 +114,7 @@ This is a specialization of `soap-sample-value' for (cond ((soap-xs-simple-type-enumeration type) (let ((enumeration (soap-xs-simple-type-enumeration type))) - (nth (random (length enumeration)) enumeration))) + (and enumeration (seq-random-elt enumeration)))) ((soap-xs-simple-type-pattern type) (format "a string matching %s" (soap-xs-simple-type-pattern type))) ((soap-xs-simple-type-length-range type) @@ -134,7 +134,7 @@ This is a specialization of `soap-sample-value' for (t (random 100))))) ((consp (soap-xs-simple-type-base type)) ; an union of values (let ((base (soap-xs-simple-type-base type))) - (soap-sample-value (nth (random (length base)) base)))) + (soap-sample-value (and base (seq-random-elt base))))) ((soap-xs-basic-type-p (soap-xs-simple-type-base type)) (soap-sample-value (soap-xs-simple-type-base type)))))) |