Skip to content

Commit

Permalink
TextDrawerAndroid: Handle a null fontName, saw some crash reports tha…
Browse files Browse the repository at this point in the history
…t looked like that.
  • Loading branch information
hrydgard committed May 5, 2023
1 parent 0d0b0fc commit ac88e73
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Common/Render/Text/draw_text_android.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit ac88e73

Please sign in to comment.