aboutsummaryrefslogtreecommitdiffstats
path: root/Game/Code/lib/projectM/projectM-1_0.inc
diff options
context:
space:
mode:
Diffstat (limited to 'Game/Code/lib/projectM/projectM-1_0.inc')
-rw-r--r--Game/Code/lib/projectM/projectM-1_0.inc8
1 files changed, 5 insertions, 3 deletions
diff --git a/Game/Code/lib/projectM/projectM-1_0.inc b/Game/Code/lib/projectM/projectM-1_0.inc
index 1b03f17c..8e84894d 100644
--- a/Game/Code/lib/projectM/projectM-1_0.inc
+++ b/Game/Code/lib/projectM/projectM-1_0.inc
@@ -85,10 +85,12 @@ begin
// we cannot catch C++ exceptions in delphi, so we have to check
// if configFile is valid first
- if (FileExists(configFile)) then
- data := _projectM_create1(PChar(configFile))
- else
+ if (not FileExists(configFile)) then
raise Exception.Create('Invalid file: ' + configFile);
+
+ data := _projectM_create1(PChar(configFile));
+ if (data = nil) then
+ raise Exception.Create('Creation of projectM object failed');
end;
procedure TProjectM.ResetGL(width, height: Integer);