rosgo icon indicating copy to clipboard operation
rosgo copied to clipboard

Fix invalid type assertion

Open atotto opened this issue 7 years ago • 0 comments

Hi akio-san,

I find panic on the SearchParam type assertion.

package example_test

import (
	"testing"

	"ros"
)

func TestSearchParam(t *testing.T) {
	node := ros.NewNode("/example_node")

	_, err := node.SearchParam("not_found")
	if err == nil {
		t.Errorf("want err, got nil")
	}
}

got panic:

go test
--- FAIL: TestSearchParam (0.00s)
panic: interface conversion: interface {} is nil, not string [recovered]
	panic: interface conversion: interface {} is nil, not string

atotto avatar Mar 29 '17 00:03 atotto