Avoid possible nullptr dereference

We cherry-pick the appropriate part of
https://skia-review.googlesource.com/c/skia/+/279136 to rvc-dev
to make sure we don't have a nullptr dereference.  Since that
CLs is quite large, we chose to just make this small change
instead of introduce a large change.

Bug: 154661346
Test: TreeHugger
Change-Id: I01ac23547a345b1aed8048cd83cb7a1f1e36e331
Merged-In: I7c990413b7a966f6a330289552d4520be0f3d3d1
diff --git a/src/gpu/vk/GrVkTexture.cpp b/src/gpu/vk/GrVkTexture.cpp
index ca8a2ce..00855f9 100644
--- a/src/gpu/vk/GrVkTexture.cpp
+++ b/src/gpu/vk/GrVkTexture.cpp
@@ -237,7 +237,9 @@
     if (callFinishProcs) {
         // Everything must go!
         fIdleProcs.reset();
-        resource->resetIdleProcs();
+        if (resource) {
+            resource->resetIdleProcs();
+        }
     } else {
         // The procs that should be called on flush but not finish are those that are owned
         // by the GrVkTexture and not the Resource. We do this by copying the resource's array