aboutsummaryrefslogtreecommitdiff
path: root/src/models.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/models.c')
-rw-r--r--src/models.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/models.c b/src/models.c
index 1ae95f23..539af3f9 100644
--- a/src/models.c
+++ b/src/models.c
@@ -1290,6 +1290,12 @@ static VertexData LoadOBJ(const char *fileName)
FILE *objFile;
objFile = fopen(fileName, "rt");
+
+ if (objFile == NULL)
+ {
+ TraceLog(WARNING, "[%s] OBJ file could not be opened", fileName);
+ return vData;
+ }
// First reading pass: Get numVertex, numNormals, numTexCoords, numTriangles
// NOTE: vertex, texcoords and normals could be optimized (to be used indexed on faces definition)