diff --git a/sources/reactphysics3d/mathematics/Matrix.cpp b/sources/reactphysics3d/mathematics/Matrix.cpp index db72a54f..cf48744c 100644 --- a/sources/reactphysics3d/mathematics/Matrix.cpp +++ b/sources/reactphysics3d/mathematics/Matrix.cpp @@ -18,6 +18,7 @@ ***************************************************************************/ // Libraries +#include #include "Matrix.h" // Namespaces @@ -31,6 +32,9 @@ Matrix::Matrix(int nbRow, int nbColumn) throw(std::invalid_argument) // Create the two dimensional dynamic array array = new double*[nbRow]; + + assert(array != 0); // Array pointer musn't be null + for(int i=0; i0) { + if (dimension > 0) { // Create a new matrix Matrix identityMatrix(dimension,dimension); @@ -248,7 +262,7 @@ Matrix Matrix::identityMatrix(int dimension) throw(std::invalid_argument) { } else { // Throw an exception - throw std::invalid_argument("Exception : The argument of identityMatrix() has to be positive !"); + throw std::invalid_argument("Exception : The argument of identity() has to be positive !"); } }