]> git.mxchange.org Git - flightgear.git/blobdiff - src/Sound/morse.cxx
Dont execute code in case the soundmanager isn't properly initialized
[flightgear.git] / src / Sound / morse.cxx
index 855d7b2651b052c0c23ef7b7915c954f3641d02f..92b671bca4471ee7def602724f47361f756c8af3 100644 (file)
@@ -16,7 +16,7 @@
 //
 // You should have received a copy of the GNU General Public License
 // along with this program; if not, write to the Free Software
-// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 //
 // $Id$
 
@@ -167,6 +167,11 @@ bool FGMorse::cust_init(const int freq ) {
 
 // make a SGSoundSample morse code transmission for the specified string
 SGSoundSample *FGMorse::make_ident( const string& id, const int freq ) {
+
+    if (globals->get_soundmgr()->is_working() == false) {
+       return 0;
+    }
+
     char *idptr = (char *)id.c_str();
 
     int length = 0;