From 24bd7151e24d88e3457fedb32f784c696c839c68 Mon Sep 17 00:00:00 2001 From: Alex Bligh Date: Fri, 10 Apr 2015 14:59:57 +0100 Subject: [PATCH] Error if neither -iface or -name is specified This prevents a nil pointer dereference if (e.g.) weaver is invoked with no arguments. Signed-off-by: Alex Bligh --- weaver/main.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/weaver/main.go b/weaver/main.go index eb8fc476..c1a26221 100644 --- a/weaver/main.go +++ b/weaver/main.go @@ -92,6 +92,9 @@ func main() { } if routerName == "" { + if iface == nil { + log.Fatal("Either an interface must be specified with -iface or a name with -name") + } routerName = iface.HardwareAddr.String() }