Fix #892, LuaScriptReader wasn't checking if opening the file actually succeeded.

Check, and throw an exception if it fails.

Originally committed to SVN as r3065.
This commit is contained in:
Niels Martin Hansen 2009-06-16 21:21:25 +00:00
parent bab71db434
commit e0a3aeca3d
1 changed files with 2 additions and 0 deletions

View File

@ -49,6 +49,8 @@ namespace Automation4 {
#else
f = fopen(filename.fn_str(), "rb");
#endif
if (!f)
throw _T("Could not open script file");
first = true;
databuf = new char[bufsize];
}