mojoshader_effects.c
changeset 1270 fb28ba997299
parent 1269 5ed167069622
--- a/mojoshader_effects.c	Thu Jun 25 10:10:52 2020 -0400
+++ b/mojoshader_effects.c	Thu Jun 25 10:35:29 2020 -0400
@@ -686,6 +686,12 @@
             object->shader.shader = effect->ctx.compileShader(mainfn, *ptr, length,
                                                               swiz, swizcount,
                                                               smap, smapcount);
+            if (object->shader.shader == NULL)
+            {
+                // Bail ASAP, so we can get the error to the application
+                errorlist_add(errors, NULL, 0, effect->ctx.getError());
+                return;
+            } // if
             pd = effect->ctx.getParseData(object->shader.shader);
             if (pd->error_count > 0)
             {
@@ -816,6 +822,12 @@
                 object->shader.shader = effect->ctx.compileShader(mainfn, *ptr, length,
                                                                   swiz, swizcount,
                                                                   smap, smapcount);
+                if (object->shader.shader == NULL)
+                {
+                    // Bail ASAP, so we can get the error to the application
+                    errorlist_add(errors, NULL, 0, effect->ctx.getError());
+                    return;
+                } // if
                 pd = effect->ctx.getParseData(object->shader.shader);
                 if (pd->error_count > 0)
                 {