SDL: Fixed crash trying to create a metal view with the dummy driver

From 4e8d1ec98373444e872d47668cdbfa072a5fe501 Mon Sep 17 00:00:00 2001
From: Sam Lantinga <[EMAIL REDACTED]>
Date: Tue, 7 Nov 2023 15:32:40 -0800
Subject: [PATCH] Fixed crash trying to create a metal view with the dummy
 driver

---
 src/video/SDL_video.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/video/SDL_video.c b/src/video/SDL_video.c
index bb983b902a01..aa1fee7298c6 100644
--- a/src/video/SDL_video.c
+++ b/src/video/SDL_video.c
@@ -5138,6 +5138,11 @@ SDL_MetalView SDL_Metal_CreateView(SDL_Window *window)
 {
     CHECK_WINDOW_MAGIC(window, NULL);
 
+    if (!_this->Metal_CreateView) {
+        SDL_Unsupported();
+        return NULL;
+    }
+
     if (!(window->flags & SDL_WINDOW_METAL)) {
         /* No problem, we can convert to Metal */
         if (window->flags & SDL_WINDOW_OPENGL) {