Add nullptr check before passing arg (#1825)

This commit is contained in:
Tobias Mock 2021-06-13 11:52:24 +02:00 committed by GitHub
parent 7d03048f1d
commit 929fa5780d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -115,7 +115,7 @@ char* CharReplace(char* text, char search, char replace);
int main(int argc, char* argv[])
{
// Help
if (IsTextEqual(argv[1], "--help", 6)) {
if (argv[1] != NULL && IsTextEqual(argv[1], "--help", 6)) {
printf("Usage:\n");
printf(" raylib_parser [--json]\n");
return 0;
@ -123,7 +123,7 @@ int main(int argc, char* argv[])
// Allow changing the output format.
int outputFormat = 0;
if (IsTextEqual(argv[1], "--json", 6)) {
if (argv[1] != NULL && IsTextEqual(argv[1], "--json", 6)) {
outputFormat = JSON;
}