Sdk/LuaAPI: Improve error check
Former-commit-id: 5c33dd47c3da1c5957704272405dcd6c26117c0f
This commit is contained in:
parent
9d210eb2ff
commit
642f139da9
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in New Issue