From 3beabb6c19248ded4c3e09203f88cd7e71a34dc4 Mon Sep 17 00:00:00 2001 From: James Brown Date: Sun, 12 May 2002 10:18:40 +0000 Subject: Fix crash if envvar not set. svn-id: r4286 --- sound/mididrv.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'sound/mididrv.cpp') 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; } -- cgit v1.2.3