Throw an error if DirExists called with empty path.
This commit is contained in:
parent
50399f25f4
commit
fc5149a1c7
@ -616,7 +616,12 @@ static cell_t sm_DirExists(IPluginContext *pContext, const cell_t *params)
|
|||||||
{
|
{
|
||||||
char *name;
|
char *name;
|
||||||
pContext->LocalToString(params[1], &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)
|
if (params[0] >= 2 && params[2] == 1)
|
||||||
{
|
{
|
||||||
char *pathID;
|
char *pathID;
|
||||||
|
Loading…
Reference in New Issue
Block a user