Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app/assets/javascripts/lib/utils/text_utility.js')
-rw-r--r--app/assets/javascripts/lib/utils/text_utility.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/assets/javascripts/lib/utils/text_utility.js b/app/assets/javascripts/lib/utils/text_utility.js
index 6c30294cbbb..b30eba25aa8 100644
--- a/app/assets/javascripts/lib/utils/text_utility.js
+++ b/app/assets/javascripts/lib/utils/text_utility.js
@@ -173,7 +173,7 @@ export const truncateSha = (sha) => sha.substring(0, 8);
* @return {String}
*/
export function capitalizeFirstCharacter(text) {
- return `${text[0].toUpperCase()}${text.slice(1)}`;
+ return text?.length ? `${text[0].toUpperCase()}${text.slice(1)}` : '';
}
/**