1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00

Direct2D: Add null check before reading from D2D texture

This commit is contained in:
reuk 2024-08-13 14:51:34 +01:00
parent 19aade443a
commit bb53174196
No known key found for this signature in database
GPG key ID: FCB43929F012EE5C

View file

@ -615,7 +615,9 @@ public:
if (presentParameters.DirtyRectsCount == 0)
{
D2D1_POINT_2U destPoint { 0, 0 };
swap.buffer->CopyFromBitmap (&destPoint, paintedPresentation->getPresentationBitmap(), nullptr);
if (auto bitmap = paintedPresentation->getPresentationBitmap())
swap.buffer->CopyFromBitmap (&destPoint, bitmap, nullptr);
}
// Present the freshly painted buffer