You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jun 27, 2020. It is now read-only.
When iterating through comments to get all the replies in a tree, I often run into a problem where a nil object is returned as part of the initial comments array, and I'm fairly certain the top level list of comments isn't complete. It happens more frequently on links with > 200 comments.
Example code, in case I'm just missing something basic:
def iterate_through_replies( comment )
replies = comment.replies
if !replies.empty?
replies.each do |r|
iterate_through_replies( r )
end
end
end
link = RedditKit.link( some_full_name )
comments = RedditKit.comments( link.id )
comments.each do |c|
iterate_through_replies( c )
end
At some point this error gets returned: in 'iterate_through_replies': undefined method 'replies' for nil:NilClass (NoMethodError)
Is a comment getting parsed weirdly? Maybe this is related to this PRAW issue?
The text was updated successfully, but these errors were encountered:
BukhariH
added a commit
to BukhariH/RedditKit.rb
that referenced
this issue
Oct 27, 2014
When iterating through comments to get all the replies in a tree, I often run into a problem where a nil object is returned as part of the initial comments array, and I'm fairly certain the top level list of comments isn't complete. It happens more frequently on links with > 200 comments.
Example code, in case I'm just missing something basic:
At some point this error gets returned:
in 'iterate_through_replies': undefined method 'replies' for nil:NilClass (NoMethodError)
Is a comment getting parsed weirdly? Maybe this is related to this PRAW issue?
The text was updated successfully, but these errors were encountered: