Don't crash when connecting a debug preview to an input

This commit is contained in:
Marc Gilleron 2022-03-20 16:50:18 +00:00
parent a6196bd84d
commit cda68657b0
2 changed files with 7 additions and 0 deletions

View File

@ -38,7 +38,9 @@ Godot 4 is required from this version.
- `VoxelBuffer`: frequently creating buffers with always different sizes no longer wastes memory
- `Voxel`: properties of the inspector were not refreshed when changing `geometry_type`
- `VoxelGeneratorGraph`: editor: fix inspector starting to throw errors after deleting a node, as it is still inspecting it
- `VoxelGeneratorGraph`: editor: fixed crash when connecting an SdfPreview node to an input. However this is not supported yet.
- `VoxelGeneratorGraph`: fixed Image2D node not accepting image formats L8 and LA8
- `VoxelMesherTransvoxel`: fixed surface not appearing if it lines up exactly at integer coordinates
- `VoxelTerrain`: fixed `Condition "mesh_block == nullptr" is true` which could happen in some conditions
- `VoxelTool`: `raycast` locking up if you send a Vector3 containing NaN
- `VoxelInstancer`: fix instances not refreshing when an item is modified and the mesh block size is 32

View File

@ -723,6 +723,11 @@ void VoxelGraphEditor::update_slice_previews() {
Image &im = **info.control->get_image();
ERR_FAIL_COND(im.get_width() * im.get_height() != static_cast<int>(buffer.size));
// TODO Support debugging inputs
ERR_CONTINUE_MSG(buffer.data == nullptr,
buffer.is_binding ? "Plugging a debug view on an input is not supported yet."
: "Didn't expect buffer to be null");
unsigned int i = 0;
for (int y = 0; y < im.get_height(); ++y) {
for (int x = 0; x < im.get_width(); ++x) {