mirror of
https://github.com/dmuth/diceware.git
synced 2024-11-28 21:15:16 -05:00
Fixed bug for when the word isn't found in the wordlist.
This commit is contained in:
parent
7b5c1bb9ce
commit
fda158bd7c
1 changed files with 9 additions and 1 deletions
8
main.js
8
main.js
|
@ -73,7 +73,15 @@ function roll_dice() {
|
||||||
*/
|
*/
|
||||||
function get_word(wordlist, index) {
|
function get_word(wordlist, index) {
|
||||||
var retval = wordlist[index];
|
var retval = wordlist[index];
|
||||||
|
|
||||||
|
if (retval) {
|
||||||
retval = retval[0].toUpperCase() + retval.slice(1);
|
retval = retval[0].toUpperCase() + retval.slice(1);
|
||||||
|
|
||||||
|
} else {
|
||||||
|
retval = "((Word not found in wordlist)) ";
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
return(retval);
|
return(retval);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue