i am writing chess in java, this code for checking weather there are obstacles for bishop sometimes works and in some cases doesn't.
can you please explain me my mistakes
thanks!

```
public boolean checkifEmpty(int fromRow, int fromColumn, int toRow,
            int toColumn, Figure[][] ChessBoard) {
        int differenceInRows = Math.abs(fromRow - toRow);
        if (differenceInRows == 1 ) {
            return true;
        }

        for (int j = 1; j < differenceInRows; j++) {
            if ((toRow < fromRow) && (toColumn > fromColumn)
                    && ChessBoard[fromRow - j][fromColumn + j] == null) {
                return true;
            } else if ((toRow > fromRow) && (toColumn > fromColumn)
                    && ChessBoard[fromRow + j][fromColumn + j] == null) {
                return true;
            } else if ((toRow > fromRow) && (toColumn < fromColumn)
                    && ChessBoard[fromRow + j][fromColumn - j] == null) {
                return true;
            } else if ((toRow < fromRow) && (toColumn < fromColumn)
                    && ChessBoard[fromRow - j][fromColumn - j] == null) {
                return true;
            }

        }
        return false;
    }

```