aboutsummaryrefslogtreecommitdiffstats
path: root/Game/Code/Classes/UFiles.pas
diff options
context:
space:
mode:
Diffstat (limited to 'Game/Code/Classes/UFiles.pas')
-rw-r--r--Game/Code/Classes/UFiles.pas20
1 files changed, 13 insertions, 7 deletions
diff --git a/Game/Code/Classes/UFiles.pas b/Game/Code/Classes/UFiles.pas
index 7e23b42f..717d20e2 100644
--- a/Game/Code/Classes/UFiles.pas
+++ b/Game/Code/Classes/UFiles.pas
@@ -333,16 +333,22 @@ Result := False;
//Open File and set File Pointer to the beginning
AssignFile(SongFile, Song.Path + Song.FileName);
- Reset(SongFile);
+// if assinged( SongFile ) then
+ begin
+ try
+ Reset(SongFile);
- //Clear old Song Header
- ClearSong(Song);
+ //Clear old Song Header
+ ClearSong(Song);
- //Read Header
- Result := ReadTxTHeader(Song);
+ //Read Header
+ Result := ReadTxTHeader(Song);
- //And Close File
- CloseFile(SongFile);
+ //And Close File
+ finally
+ CloseFile(SongFile);
+ end;
+ end;
{except
CloseFile(SongFile);