summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--gatchat/gatchat.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/gatchat/gatchat.c b/gatchat/gatchat.c
index 1dffd89a..df659066 100644
--- a/gatchat/gatchat.c
+++ b/gatchat/gatchat.c
@@ -1202,7 +1202,8 @@ gboolean g_at_chat_cancel(GAtChat *chat, guint id)
if (!l)
return FALSE;
- if (l == g_queue_peek_head(chat->command_queue)) {
+ if (l == g_queue_peek_head(chat->command_queue) &&
+ chat->cmd_bytes_written > 0) {
struct at_command *c = l->data;
/* We can't actually remove it since it is most likely