Fix crash when requesting MTLCommandBuffer logs in runtime debug mode on older OS versions.
diff --git a/Docs/Whats_New.md b/Docs/Whats_New.md
index da7173d..31e82ed 100644
--- a/Docs/Whats_New.md
+++ b/Docs/Whats_New.md
@@ -25,6 +25,7 @@
- Improve cache hits when matching `SPIRVToMSLConversionConfiguration` structs to each other
to find a cached shader, by only considering resources from the current shader stage.
- Rename `kMVKShaderStageMax` to `kMVKShaderStageCount`.
+- Fix crash when requesting `MTLCommandBuffer` logs in runtime debug mode on older OS versions.
- Fix internal reference from `SPIRV_CROSS_NAMESPACE_OVERRIDE` to `SPIRV_CROSS_NAMESPACE`.
diff --git a/MoltenVK/MoltenVK/GPUObjects/MVKQueue.mm b/MoltenVK/MoltenVK/GPUObjects/MVKQueue.mm
index 0c19888..fc6e06e 100644
--- a/MoltenVK/MoltenVK/GPUObjects/MVKQueue.mm
+++ b/MoltenVK/MoltenVK/GPUObjects/MVKQueue.mm
@@ -361,7 +361,7 @@
#endif
}
#if MVK_XCODE_12
- if (mvkConfig().debugMode) {
+ if (mvkConfig().debugMode && [mtlCB respondsToSelector: @selector(logs)]) {
bool isFirstMsg = true;
for (id<MTLFunctionLog> log in mtlCB.logs) {
if (isFirstMsg) {