From 6c110b9a8be81e39045dea83d2b286341000e585 Mon Sep 17 00:00:00 2001 From: Pavel Dvas Date: Thu, 8 Aug 2024 15:56:23 +0300 Subject: [PATCH] Add: check in RmFront --- api/modem/at/response.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/api/modem/at/response.go b/api/modem/at/response.go index aa1a4a3..d3d10f9 100644 --- a/api/modem/at/response.go +++ b/api/modem/at/response.go @@ -9,6 +9,9 @@ func (resp Resp) Check() bool { } func (resp Resp) RmFront(str string) Resp { + if !resp.Check() { + return RespNil + } return Resp(string(resp)[len(str):]) }