From ef6e3a167ba0c83e8f41407bb2fb07ccc2f0ec9e Mon Sep 17 00:00:00 2001
From: Nigel Kukard <nkukard@lbsd.net>
Date: Tue, 22 Oct 2013 17:11:19 +0000
Subject: [PATCH] Make sure we don't generate undefined errors

---
 opentrafficshaper/plugins/tc/tc.pm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/opentrafficshaper/plugins/tc/tc.pm b/opentrafficshaper/plugins/tc/tc.pm
index 44c1cdb..f4ae931 100644
--- a/opentrafficshaper/plugins/tc/tc.pm
+++ b/opentrafficshaper/plugins/tc/tc.pm
@@ -601,7 +601,7 @@ sub getCIDFromTcLimitClass
 	# Grab ref
 	my $ref = __getRefByMinorTcClass($interface,$majorTcClass,$minorTcClass);
 	# Chop off _class: and return if we did
-	if ($ref =~ s/^_class_://) {
+	if (defined($ref) && $ref =~ s/^_class_://) {
 		return $ref;
 	}
 
-- 
GitLab