mirror of
https://github.com/dmuth/diceware.git
synced 2024-12-22 16:23:42 +00: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
10
main.js
10
main.js
|
@ -73,7 +73,15 @@ function roll_dice() {
|
|||
*/
|
||||
function get_word(wordlist, index) {
|
||||
var retval = wordlist[index];
|
||||
retval = retval[0].toUpperCase() + retval.slice(1);
|
||||
|
||||
if (retval) {
|
||||
retval = retval[0].toUpperCase() + retval.slice(1);
|
||||
|
||||
} else {
|
||||
retval = "((Word not found in wordlist)) ";
|
||||
|
||||
}
|
||||
|
||||
return(retval);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue