layers: Add missing null-check in DrawState
diff --git a/layers/draw_state.cpp b/layers/draw_state.cpp
index fa1cbfa..a5b42bd 100644
--- a/layers/draw_state.cpp
+++ b/layers/draw_state.cpp
@@ -2380,9 +2380,10 @@
return VK_ERROR_VALIDATION_FAILED;
}
VkResult result = dev_data->device_dispatch_table->BeginCommandBuffer(commandBuffer, pBeginInfo);
- if (VK_SUCCESS == result) {
- if (CB_NEW != pCB->state)
+ if ((VK_SUCCESS == result) && (pCB != NULL)) {
+ if (CB_NEW != pCB->state) {
resetCB(dev_data, commandBuffer);
+ }
pCB->state = CB_UPDATE_ACTIVE;
updateCBTracking(pCB);
}