From bc853ad309054d1d16be4056be033a7d39a33ed7 Mon Sep 17 00:00:00 2001
From: Rhys Arkins <rhys@arkins.net>
Date: Fri, 21 Jun 2019 21:45:34 +0200
Subject: [PATCH] fix(package-rules): check compareVersion is a version first

Closes #3952
---
 lib/util/package-rules.js | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/util/package-rules.js b/lib/util/package-rules.js
index 2be457df5e..132e24f56c 100644
--- a/lib/util/package-rules.js
+++ b/lib/util/package-rules.js
@@ -164,7 +164,7 @@ function applyPackageRules(inputConfig) {
         currentValue && isVersion(currentValue)
           ? currentValue // it's a version so we can match against it
           : lockedVersion || fromVersion; // need to match against this fromVersion, if available
-      if (compareVersion) {
+      if (compareVersion && isVersion(compareVersion)) {
         const isMatch = matches(compareVersion, matchCurrentVersion);
         positiveMatch = positiveMatch || isMatch;
         negativeMatch = negativeMatch || !isMatch;
-- 
GitLab