diff --git a/Userland/Applications/PixelPaint/Layer.cpp b/Userland/Applications/PixelPaint/Layer.cpp index a6d0d4be9e..29f5332bce 100644 --- a/Userland/Applications/PixelPaint/Layer.cpp +++ b/Userland/Applications/PixelPaint/Layer.cpp @@ -92,6 +92,9 @@ void Layer::set_name(String name) RefPtr Layer::try_copy_bitmap(Selection const& selection) const { + if (selection.is_empty()) { + return {}; + } auto selection_rect = selection.bounding_rect(); auto result = Gfx::Bitmap::create(Gfx::BitmapFormat::BGRA8888, selection_rect.size());