fix trap plugin to prevent infinite loop
Merge pull request #1202 from tuff-ghost/issue_3380e

3380e: fix trap plugin to prevent infinite loop