Skip to content

Comments

Fix invalid type assertion#10

Open
atotto wants to merge 1 commit intoakio:masterfrom
atotto:feature/fix-panic-on-param-search
Open

Fix invalid type assertion#10
atotto wants to merge 1 commit intoakio:masterfrom
atotto:feature/fix-panic-on-param-search

Conversation

@atotto
Copy link

@atotto atotto commented Mar 29, 2017

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

t-asaka added a commit to t-asaka/rosgo that referenced this pull request Sep 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant