Index: code/parse/lua.cpp
===================================================================
--- code/parse/lua.cpp	(revision 9699)
+++ code/parse/lua.cpp	(working copy)
@@ -11010,9 +11010,13 @@
     CLAMP(pan, -1.0f, 1.0f);
     CLAMP(vol, 0.0f, 100.0f);
 
-	idx = snd_play(&Snds[gamesnd_get_by_tbl_index(idx)], pan, vol*0.01f, pri, voice_msg);
-
-	return ade_set_args(L, "b", idx > -1);
+	if (gamesnd_get_by_tbl_index(idx) >= 0) {
+		idx = snd_play(&Snds[gamesnd_get_by_tbl_index(idx)], pan, vol*0.01f, pri, voice_msg);
+		return ade_set_args(L, "b", idx > -1);
+	} else {
+		LuaError(L, "Invalid sound index %i (Snds[%i]) in playGameSound()", idx, gamesnd_get_by_tbl_index(idx));
+		return ADE_RETURN_FALSE;
+	}
 }
 
 ADE_FUNC(playInterfaceSound, l_Audio, "Sound index", "Plays a sound from #Interface Sounds in sounds.tbl", "boolean", "True if sound was played, false if not")
