Sdk/LuaAPI: Improve error check

Former-commit-id: 5c33dd47c3da1c5957704272405dcd6c26117c0f
This commit is contained in:
Lynix 2016-01-21 13:07:05 +01:00
parent 9d210eb2ff
commit 642f139da9
1 changed files with 1 additions and 1 deletions

View File

@ -35,7 +35,7 @@ namespace Ndk
std::size_t bufferSize = 0;
const char* buffer = lua.CheckString(index, &bufferSize);
NazaraAssert(buffer && bufferSize < sampleCount * sizeof(Nz::Int16), "Invalid buffer");
lua.ArgCheck(buffer && bufferSize < sampleCount * sizeof(Nz::Int16), index, "Invalid buffer");
lua.PushBoolean(instance->Create(format, sampleCount, sampleRate, reinterpret_cast<const Nz::Int16*>(buffer)));
return 1;