mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-10-11 16:16:05 +08:00
added a try catch to getlastchar function
This commit is contained in:
parent
af996d3e84
commit
0b99ccdaff
1 changed files with 5 additions and 1 deletions
|
@ -321,7 +321,11 @@ export function getReleasesFromGitHub() {
|
|||
// }
|
||||
|
||||
export function getLastChar(word) {
|
||||
return word.charAt(word.length - 1);
|
||||
try {
|
||||
return word.charAt(word.length - 1);
|
||||
} catch {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
export function capitalizeFirstLetter(str) {
|
||||
|
|
Loading…
Add table
Reference in a new issue