mirror of
https://github.com/minetest/minetest.git
synced 2024-11-27 10:03:45 +01:00
Fix incorrect error message in core.encode_png
This commit is contained in:
parent
0d345dc1bd
commit
a78124831f
@ -287,7 +287,7 @@ function core.encode_png(width, height, data, compression)
|
|||||||
local expected_byte_count = width * height * 4
|
local expected_byte_count = width * height * 4
|
||||||
|
|
||||||
if type(data) ~= "table" and type(data) ~= "string" then
|
if type(data) ~= "table" and type(data) ~= "string" then
|
||||||
error("Incorrect type for 'height', expected table or string, got " .. type(height))
|
error("Incorrect type for 'data', expected table or string, got " .. type(data))
|
||||||
end
|
end
|
||||||
|
|
||||||
local data_length = type(data) == "table" and #data * 4 or string.len(data)
|
local data_length = type(data) == "table" and #data * 4 or string.len(data)
|
||||||
|
Loading…
Reference in New Issue
Block a user