aboutsummaryrefslogtreecommitdiff
path: root/sound/mididrv.cpp
diff options
context:
space:
mode:
authorJames Brown2002-05-12 10:18:40 +0000
committerJames Brown2002-05-12 10:18:40 +0000
commit3beabb6c19248ded4c3e09203f88cd7e71a34dc4 (patch)
treed2cd821723c65a9af5a423beb66dc22a251c13f6 /sound/mididrv.cpp
parentb9e335ef0fc1639bedc9a5f1482d7ad65d603ff2 (diff)
downloadscummvm-rg350-3beabb6c19248ded4c3e09203f88cd7e71a34dc4.tar.gz
scummvm-rg350-3beabb6c19248ded4c3e09203f88cd7e71a34dc4.tar.bz2
scummvm-rg350-3beabb6c19248ded4c3e09203f88cd7e71a34dc4.zip
Fix crash if envvar not set.
svn-id: r4286
Diffstat (limited to 'sound/mididrv.cpp')
-rw-r--r--sound/mididrv.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/sound/mididrv.cpp b/sound/mididrv.cpp
index 11c549b6af..0dc14f9558 100644
--- a/sound/mididrv.cpp
+++ b/sound/mididrv.cpp
@@ -386,7 +386,8 @@ int MidiDriver_SEQ::open(int mode) {
error("Cannot open /dev/null to dump midi output");
}
- _device_num = atoi(getenv("SCUMMVM_MIDIPORT"));
+ if (getenv("SCUMMVM_MIDIPORT"))
+ _device_num = atoi(getenv("SCUMMVM_MIDIPORT"));
return 0;
}