From fc5149a1c761f279eddec607a66c071d0a85c929 Mon Sep 17 00:00:00 2001 From: Nicholas Hastings Date: Tue, 10 Mar 2015 18:57:28 -0700 Subject: [PATCH] Throw an error if DirExists called with empty path. --- core/logic/smn_filesystem.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/core/logic/smn_filesystem.cpp b/core/logic/smn_filesystem.cpp index 692edc0e..14ad3161 100644 --- a/core/logic/smn_filesystem.cpp +++ b/core/logic/smn_filesystem.cpp @@ -616,7 +616,12 @@ static cell_t sm_DirExists(IPluginContext *pContext, const cell_t *params) { char *name; pContext->LocalToString(params[1], &name); - + + if (!name[0]) + { + return pContext->ThrowNativeError("Invalid path. An empty path string is not valid, use "." to refer to the current working directory."); + } + if (params[0] >= 2 && params[2] == 1) { char *pathID;