diff --git a/modules/noise/noise.cpp b/modules/noise/noise.cpp index 65ef07e2847..9b9fd640f45 100644 --- a/modules/noise/noise.cpp +++ b/modules/noise/noise.cpp @@ -166,6 +166,9 @@ Vector> Noise::_get_image(int p_width, int p_height, int p_depth, boo Ref Noise::get_image(int p_width, int p_height, bool p_invert, bool p_in_3d_space, bool p_normalize) const { Vector> images = _get_image(p_width, p_height, 1, p_invert, p_in_3d_space, p_normalize); + if (images.is_empty()) { + return Ref(); + } return images[0]; }