Skip to content
This repository was archived by the owner on Sep 11, 2023. It is now read-only.

Commit 40f7810

Browse files
committed
Fix #92
I mean, it shouldnt happen, but at least it wont crash anymore.
1 parent a310819 commit 40f7810

File tree

4 files changed

+24
-2
lines changed

4 files changed

+24
-2
lines changed

Interop/TranslationProvider.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,8 +142,9 @@ public class TranslationProvider
142142
public string Compile;
143143
public string AutoSaveMin;
144144
public string OBTextFile, OBTextConfig, OBTextItem;
145+
public string CompileErroFileError;
145146

146-
public void LoadLanguage(string lang, bool Initial = false)
147+
public void LoadLanguage(string lang, bool Initial = false)
147148
{
148149
FillToEnglishDefaults();
149150
List<string> languageList = new List<string>();
@@ -573,6 +574,8 @@ public void LoadLanguage(string lang, bool Initial = false)
573574
OBTextConfig = nv;
574575
else if (nn == "obtextitem")
575576
OBTextItem = nv;
577+
else if (nn == "errorfileerror")
578+
CompileErroFileError = nv;
576579
else
577580
throw new Exception($"{nn} is not a known language-phrase");
578581
}
@@ -784,6 +787,7 @@ private void FillToEnglishDefaults()
784787
OBTextFile = "File Dir.";
785788
OBTextConfig = "Config Dir.";
786789
OBTextItem = "Item Dir.";
790+
CompileErroFileError = "Compile error file could not be accessed.";
787791
}
788792
}
789793
}

Resources/lang_0_spedit.xml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,7 @@
192192
<obtextfile>Datei Pfad</obtextfile>
193193
<obtextconfig>Konfig. Pfad</obtextconfig>
194194
<obtextitem>Listenpunkt Pfad</obtextitem>
195+
<errorfileerror>Die compile-Fehlerdatei konnte nicht gelesen werden.</errorfileerror>
195196
</de>
196197
<fr>
197198
<language>Français</language>
@@ -386,6 +387,7 @@
386387
<obtextfile>File Dir.</obtextfile>
387388
<obtextconfig>Config Dir.</obtextconfig>
388389
<obtextitem>Item Dir.</obtextitem>
390+
<errorfileerror>Compile error file could not be accessed.</errorfileerror>
389391
</fr>
390392
<ko>
391393
<language>한국어</language>
@@ -580,6 +582,7 @@
580582
<obtextfile>File Dir.</obtextfile>
581583
<obtextconfig>Config Dir.</obtextconfig>
582584
<obtextitem>Item Dir.</obtextitem>
585+
<errorfileerror>Compile error file could not be accessed.</errorfileerror>
583586
</ko>
584587
<sv>
585588
<language>Svenska</language>
@@ -774,6 +777,7 @@
774777
<obtextfile>File Dir.</obtextfile>
775778
<obtextconfig>Config Dir.</obtextconfig>
776779
<obtextitem>Item Dir.</obtextitem>
780+
<errorfileerror>Compile error file could not be accessed.</errorfileerror>
777781
</sv>
778782
<ru>
779783
<language>Русский</language>
@@ -968,6 +972,7 @@
968972
<obtextfile>File Dir.</obtextfile>
969973
<obtextconfig>Config Dir.</obtextconfig>
970974
<obtextitem>Item Dir.</obtextitem>
975+
<errorfileerror>Compile error file could not be accessed.</errorfileerror>
971976
</ru>
972977
<pt>
973978
<language>Português</language>
@@ -1162,6 +1167,7 @@
11621167
<obtextfile>File Dir.</obtextfile>
11631168
<obtextconfig>Config Dir.</obtextconfig>
11641169
<obtextitem>Item Dir.</obtextitem>
1170+
<errorfileerror>Compile error file could not be accessed.</errorfileerror>
11651171
</pt>
11661172
<pl>
11671173
<language>Polski</language>
@@ -1356,6 +1362,7 @@
13561362
<obtextfile>File Dir.</obtextfile>
13571363
<obtextconfig>Config Dir.</obtextconfig>
13581364
<obtextitem>Item Dir.</obtextitem>
1365+
<errorfileerror>Compile error file could not be accessed.</errorfileerror>
13591366
</pl>
13601367
<tr>
13611368
<language>Türkçe</language>
@@ -1550,6 +1557,7 @@
15501557
<obtextfile>File Dir.</obtextfile>
15511558
<obtextconfig>Config Dir.</obtextconfig>
15521559
<obtextitem>Item Dir.</obtextitem>
1560+
<errorfileerror>Compile error file could not be accessed.</errorfileerror>
15531561
</tr>
15541562
<zhCN>
15551563
<language>简体中文</language>
@@ -1744,6 +1752,7 @@
17441752
<obtextfile>文件目录</obtextfile>
17451753
<obtextconfig>配置档目录</obtextconfig>
17461754
<obtextitem>物件目录</obtextitem>
1755+
<errorfileerror>Compile error file could not be accessed.</errorfileerror>
17471756
</zhCN>
17481757
<zhTW>
17491758
<language>繁體中文</language>
@@ -1938,5 +1947,6 @@
19381947
<obtextfile>文件目錄</obtextfile>
19391948
<obtextconfig>配置檔目錄</obtextconfig>
19401949
<obtextitem>物件目錄</obtextitem>
1950+
<errorfileerror>Compile error file could not be accessed.</errorfileerror>
19411951
</zhTW>
19421952
</translations>

Resources/lang_0_spedit_entryTemplate.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,4 +191,5 @@
191191
<obtextfile>File Dir.</obtextfile>
192192
<obtextconfig>Config Dir.</obtextconfig>
193193
<obtextitem>Item Dir.</obtextitem>
194+
<errorfileerror>Compile error file could not be accessed.</errorfileerror>
194195
</en>

UI/MainWindowSPCompiler.cs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,14 @@ private async void Compile_SPScripts(bool All = true)
163163
details = mc[j].Groups["details"].Value.Trim()
164164
});
165165
}
166-
File.Delete(errorFile);
166+
try
167+
{
168+
File.Delete(errorFile);
169+
}
170+
catch (Exception)
171+
{
172+
stringOutput.AppendLine(Program.Translations.CompileErroFileError);
173+
}
167174
}
168175
stringOutput.AppendLine(Program.Translations.Done);
169176
if (File.Exists(outFile))

0 commit comments

Comments
 (0)