Skip to content

Commit 831a467

Browse files
committed
fix bug where passing an empty creatureType would cause toUpperCase() to fail
1 parent f9b5c69 commit 831a467

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/components/CardModel.vue

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,6 @@ export default {
107107
resolveImage(path) {
108108
return require('../assets/images/cards/' + path);
109109
},
110-
111110
/**
112111
* Adjusts the size of the font to be displayed on a CardModel
113112
* based on the length of the text and whether it is all caps.
@@ -117,6 +116,9 @@ export default {
117116
*/
118117
adjustFontSize(text) {
119118
let baselineEm = 1.1;
119+
if (!text) {
120+
return baselineEm;
121+
}
120122
const isAllCaps = text === text.toUpperCase();
121123
const length = text.length;
122124
if (length >= 20) {

0 commit comments

Comments
 (0)