aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/libmpdclient.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/libmpdclient.c b/src/libmpdclient.c
index 2b4a52c85..dfca0a347 100644
--- a/src/libmpdclient.c
+++ b/src/libmpdclient.c
@@ -451,6 +451,12 @@ static void mpd_executeCommand(mpd_Connection *connection,
const char *commandPtr = command;
int commandLen = strlen(command);
+ if (connection->sock < 0) {
+ strcpy(connection->errorStr, "not connected");
+ connection->error = MPD_ERROR_CONNCLOSED;
+ return;
+ }
+
if (!connection->doneProcessing && !connection->commandList) {
strcpy(connection->errorStr,
"not done processing current command");