Skip to content

Commit

Permalink
hopefully fix access to comments array
Browse files Browse the repository at this point in the history
  • Loading branch information
T-Damer committed May 31, 2023
1 parent bb2dfcf commit da71b9f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions contracts/superclasses/Posts.sol
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ contract Posts is KetlGuarded {
// Fetch post or comment
Post memory post = commentId == 0
? posts[feedId][postId]
: comments[feedId][postId][commentId];
: comments[feedId][postId][commentId - 1];
// Check if post or comment exists
require(post.sender != address(0), "Post or comment not found");
// Get old reaction if it exists
Expand Down Expand Up @@ -400,7 +400,7 @@ contract Posts is KetlGuarded {
// Fetch post or comment
Post memory post = commentId == 0
? posts[feedId][postId]
: comments[feedId][postId][commentId];
: comments[feedId][postId][commentId - 1];
// Check if post or comment exists
require(post.sender != address(0), "Post or comment not found");
// Check if sent by the owner
Expand Down

0 comments on commit da71b9f

Please sign in to comment.