mirror of
https://github.com/libretro/scummvm.git
synced 2025-01-31 07:53:36 +00:00
BASE: Fix NPE when executable name is not available
This commit is contained in:
parent
962383eb3e
commit
1daf70c746
@ -418,7 +418,7 @@ extern "C" int scummvm_main(int argc, const char * const argv[]) {
|
||||
bool autodetect = false;
|
||||
|
||||
// Check for the autorun name
|
||||
if (argv[0]) {
|
||||
if (argc && argv && argv[0]) {
|
||||
const char *s = strrchr(argv[0], '/');
|
||||
|
||||
if (!s)
|
||||
@ -444,7 +444,7 @@ extern "C" int scummvm_main(int argc, const char * const argv[]) {
|
||||
Common::String line;
|
||||
Common::String res;
|
||||
|
||||
autorunArgs.push_back(argv[0]);
|
||||
autorunArgs.push_back(argc && argv ? argv[0] : "");
|
||||
|
||||
if (autorun.open("scummvm-autorun")) {
|
||||
while (!autorun.eos()) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user