diff --git a/scan/route_params.go b/scan/route_params.go
index <HASH>..<HASH> 100644
--- a/scan/route_params.go
+++ b/scan/route_params.go
@@ -4,6 +4,7 @@ import (
 	"github.com/go-openapi/spec"
 	"strconv"
 	"strings"
+	"errors"
 )
 
 const (
@@ -99,6 +100,10 @@ func (s *setOpParams) Parse(lines []string) error {
 		key := strings.ToLower(strings.TrimSpace(kv[0]))
 		value := strings.TrimSpace(kv[1])
 
+		if current == nil {
+			return errors.New("invalid route/operation schema provided")
+		}
+
 		switch key {
 		case ParamDescriptionKey:
 			current.Description = value
fixed "runtime error: invalid memory address or nil pointer dereference" when invalid signature for route provided