Skip to content

Commit f3116ec

Browse files
committed
Small bugfix
1 parent 1b5cd63 commit f3116ec

File tree

2 files changed

+16
-3
lines changed

2 files changed

+16
-3
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -347,3 +347,4 @@ healthchecksdb
347347
/script.srp
348348
/temp.txt
349349
/CustomShell/scriptInterpreter
350+
/script.rls

CustomShell/ScriptInterpreter.cs

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,11 +70,23 @@ private void ReadScriptFile(string filePath)
7070
filePath = main.GetPathType(filePath);
7171

7272
if (!filePath.EndsWith(".rls"))
73+
{
74+
main.AddTextToConsole("Not a .rls file...");
75+
return;
76+
}
77+
78+
try
79+
{
80+
lines = File.ReadAllLines(filePath);
81+
file = File.ReadAllLines(filePath);
82+
CreateTokens();
83+
}
84+
catch (Exception)
85+
{
86+
main.AddTextToConsole("File could not be found...");
7387
return;
88+
}
7489

75-
lines = File.ReadAllLines(filePath);
76-
file = File.ReadAllLines(filePath);
77-
CreateTokens();
7890
}
7991

8092
private void CreateTokens()

0 commit comments

Comments
 (0)