diff --git a/source/Base/ScriptSrc.cpp b/source/Base/ScriptSrc.cpp index 20e03f6f..209b1b49 100644 --- a/source/Base/ScriptSrc.cpp +++ b/source/Base/ScriptSrc.cpp @@ -150,8 +150,13 @@ ScriptSrc::ScriptSrc(HSQUIRRELVM vm, const String & path, bool info) { throw std::runtime_error("Invalid or empty script path"); } + // Is the specified virtual machine invalid? + else if (!vm) + { + throw std::runtime_error("Invalid virtual machine pointer"); + } // Should we load the file contents for debugging purposes? - if (info) + else if (info) { Process(); } diff --git a/source/Base/ScriptSrc.hpp b/source/Base/ScriptSrc.hpp index e935da9e..2820a6d4 100644 --- a/source/Base/ScriptSrc.hpp +++ b/source/Base/ScriptSrc.hpp @@ -19,9 +19,6 @@ class Core; */ class ScriptSrc { - // -------------------------------------------------------------------------------------------- - friend class Core; - public: // -------------------------------------------------------------------------------------------- @@ -33,8 +30,6 @@ public: String mData; // The contents of the script file. Line mLine; // List of lines of code in the data. -private: - /* -------------------------------------------------------------------------------------------- * Read file contents and calculate information about the lines of code. */ @@ -45,8 +40,6 @@ private: */ ScriptSrc(HSQUIRRELVM vm, const String & path, bool info = false); -public: - /* -------------------------------------------------------------------------------------------- * Copy constructor. */