Skip to content

Commit b2336d5

Browse files
committed
handle crash in updatetexture
1 parent 0a02a4b commit b2336d5

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

Plugins/Stereolabs/Source/Stereolabs/Private/Core/StereolabsTexture.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,8 @@ void USlTexture::BP_UpdateTextureWithMat(const FSlMat& NewMat)
143143

144144
void USlTexture::UpdateTexture()
145145
{
146+
if (!Mat.Mat) return;
147+
146148
if (!bCudaInteropEnabled)
147149
{
148150
sl_mat_update_cpu_from_gpu(Mat.Mat);
@@ -177,6 +179,8 @@ void USlTexture::UpdateTexture()
177179

178180
void USlTexture::UpdateTexture(const FSlMat& NewMat)
179181
{
182+
if (!NewMat.Mat) return;
183+
180184
if (!bCudaInteropEnabled)
181185
{
182186
sl_mat_update_cpu_from_gpu(NewMat.Mat);
@@ -211,6 +215,8 @@ void USlTexture::UpdateTexture(const FSlMat& NewMat)
211215

212216
void USlTexture::UpdateTexture(void* NewMat)
213217
{
218+
if (!NewMat) return;
219+
214220
if (!bCudaInteropEnabled)
215221
{
216222
sl_mat_update_cpu_from_gpu(NewMat);

0 commit comments

Comments
 (0)