vrt-ruby icon indicating copy to clipboard operation
vrt-ruby copied to clipboard

Let VRT::Map#find_node accept nil values

Open adamrdavid opened this issue 6 years ago • 4 comments

Description

Make VRT::Map#find_node more durable to unexpected input

  • Resolves: https://github.com/bugcrowd/vrt-ruby/issues/32
  • Also adds some much needed spec coverage around VRT::Map#find_node

Checklist:

  • [x] I have made corresponding changes to the documentation
  • [x] I have added tests that prove my fix is effective or that my feature works
  • [x] I have added entries to CHANGELOG.md
  • [x] I have not incremented version.rb

adamrdavid avatar May 30 '18 03:05 adamrdavid

@adamrdavid what do you think about putting this check in walk_tree instead?

maschwenk avatar May 30 '18 21:05 maschwenk

@maschwenk the error that get's raised when string is nil comes from string + max_depth

I have updated the readme to better describe the situation.

adamrdavid avatar May 30 '18 23:05 adamrdavid

@adamrdavid I guess it makes no sense to try to cache invalid vrt_ids so this is ok

maschwenk avatar May 31 '18 00:05 maschwenk

At any rate this needs to be added to get_lineage since that exhibits the same behavior of calling input + thing. If you think of a better place to put the check let me know.

adamrdavid avatar Jun 05 '18 18:06 adamrdavid