NSW court dismisses man's weapons charge