[graphite] Bail on DM run when context creation fails.

This leads to a crash when trying to precompile otherwise.

Change-Id: I40264b9ec09078214f2ff01837d4ff945742994a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/494820
Auto-Submit: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
diff --git a/dm/DMSrcSink.cpp b/dm/DMSrcSink.cpp
index 6eda694..55951ff 100644
--- a/dm/DMSrcSink.cpp
+++ b/dm/DMSrcSink.cpp
@@ -2159,6 +2159,9 @@
 
     skiatest::graphite::ContextFactory factory;
     auto [_, context] = factory.getContextInfo(fContextType);
+    if (!context) {
+        return Result::Fatal("Could not create a context.");
+    }
 
     if (fTestPrecompile) {
         precompile(context.get());