TextDrawerAndroid: Handle a null fontName, saw some crash reports that looked like that.

This commit is contained in:
Henrik Rydgård 2023-05-05 23:40:06 +02:00
parent 0d0b0fc60b
commit ac88e73768

View File

@ -47,7 +47,7 @@ bool TextDrawerAndroid::IsReady() const {
uint32_t TextDrawerAndroid::SetFont(const char *fontName, int size, int flags) {
// We will only use the default font but just for consistency let's still involve
// the font name.
uint32_t fontHash = hash::Adler32((const uint8_t *)fontName, strlen(fontName));
uint32_t fontHash = fontName ? hash::Adler32((const uint8_t *)fontName, strlen(fontName)) : 1337;
fontHash ^= size;
fontHash ^= flags << 10;