checked if text is empty to return early
This commit is contained in:
parent
dc86f5e04a
commit
beab63887c
|
|
@ -1430,7 +1430,7 @@ bool TextIsEqual(const char *text1, const char *text2)
|
||||||
// Get a piece of a text string
|
// Get a piece of a text string
|
||||||
const char *TextSubtext(const char *text, int position, int length)
|
const char *TextSubtext(const char *text, int position, int length)
|
||||||
{
|
{
|
||||||
if (!length)
|
if (!length || !text)
|
||||||
return "";
|
return "";
|
||||||
int textLength = TextLength(text);
|
int textLength = TextLength(text);
|
||||||
if (position >= textLength)
|
if (position >= textLength)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user