From bbccdfe3fb739945808cbbb30537d24dff09dce5 Mon Sep 17 00:00:00 2001 From: EliteMasterEric Date: Wed, 1 May 2024 13:40:46 -0400 Subject: [PATCH] Fix issue when git status returns empty string. --- source/funkin/util/macro/GitCommit.hx | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/source/funkin/util/macro/GitCommit.hx b/source/funkin/util/macro/GitCommit.hx index 5ca16e030..161856caa 100644 --- a/source/funkin/util/macro/GitCommit.hx +++ b/source/funkin/util/macro/GitCommit.hx @@ -80,7 +80,24 @@ class GitCommit haxe.macro.Context.info('[WARN] Could not determine current git commit; is this a proper Git repository?', pos); } - var output:String = branchProcess.stdout.readLine(); + var output:String = ''; + try + { + output = branchProcess.stdout.readLine(); + } + catch (e) + { + if (e.message == 'Eof') + { + // Do nothing. + // Eof = No output. + } + else + { + // Rethrow other exceptions. + throw e; + } + } trace('Git Status Output: ${output}'); // Generates a string expression