From e3f0f4230c5c6671179dd98278fb490796360eef Mon Sep 17 00:00:00 2001 From: Giovanni Harting <539@idlegandalf.com> Date: Fri, 13 Oct 2023 20:56:30 +0200 Subject: [PATCH] check for empty string after warning replace --- proto_package.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/proto_package.go b/proto_package.go index 199e061..1926461 100644 --- a/proto_package.go +++ b/proto_package.go @@ -468,6 +468,10 @@ func (p *ProtoPackage) isAvailable(h *alpm.Handle) bool { // workaround for https://github.com/andrewgregory/pacutils/issues/66 // TODO: remove once fixed rRes := reReplacePacsiftWarning.ReplaceAllString(string(res), "") + if len(strings.TrimSpace(rRes)) == 0 { + return false + } + if len(strings.Split(strings.TrimSpace(rRes), "\n")) > 0 { pacsiftLines := strings.Split(strings.TrimSpace(rRes), "\n")