mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-13 06:51:51 +00:00
Potential nullptr access fix
This commit is contained in:
parent
ad81e64461
commit
57e9cade7b
1 changed files with 3 additions and 0 deletions
|
|
@ -179,6 +179,9 @@ static int l_set_chunk_data(lua::State* L) {
|
||||||
is_compressed = lua::toboolean(L, 4);
|
is_compressed = lua::toboolean(L, 4);
|
||||||
}
|
}
|
||||||
auto chunk = level->chunks->getChunk(x, y);
|
auto chunk = level->chunks->getChunk(x, y);
|
||||||
|
if(chunk== nullptr){
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
if (is_compressed) {
|
if (is_compressed) {
|
||||||
std::vector<ubyte>& raw_data = buffer->data();
|
std::vector<ubyte>& raw_data = buffer->data();
|
||||||
size_t gzip_decompressed_size =
|
size_t gzip_decompressed_size =
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue