参数校验

This commit is contained in:
imndx
2020-06-09 17:11:48 +08:00
parent 599547d627
commit 7e56fe2ee0
@@ -2271,6 +2271,10 @@ public class MemoryMessagesStore implements IMessagesStore {
@Override @Override
public ErrorCode blackUserRequest(String fromUser, String targetUserId, int state, long[] heads) { public ErrorCode blackUserRequest(String fromUser, String targetUserId, int state, long[] heads) {
if(state != 0 && state != 1 && state != 2){
return ErrorCode.INVALID_PARAMETER;
}
if (state == 2) { if (state == 2) {
state = 1; state = 1;
} }