Code giving Exception

public class Main
{
public static Boolean isItSaafe(Boolean board[][] , int row , int col){

    int r = row-1 ;
    int c = col ;
    
    //vertically Upward
    
    while(r >= 0){
        if(board[r][c]){
          return false ;  
        }
        r-- ;
    }
    
    //horizontally left 
    r = row ;
    c = col -1 ;
    
    while(c >= 0){
       if(board[r][c]){
          return false ;  
        }
        
        c--;
    }
    
    //vertically left 
    r = row -1 ;
    c = col -1 ;
    
    while(r >= 0 && c >= 0){
       if(board[r][c]){
          return false ;  
        }
        r-- ; 
        c-- ;
    }
    
    // vertically right
     r = row -1 ;
     col = col +1 ;
     
     while(r >= 0 && c <= board[0].length)
    {
        if(board[r][c]){
          return false ;  
        }
        r-- ;
        c++ ;
    }
    return true ;
}
public static void Nqueen_2(Boolean board[][] , int row , int tq , int qpsf , String ans){
    
    if(tq == qpsf)
    {
        System.out.println(ans);
        return ;
    }
    
    if(row == board.length)
    return ;
    
    for(int i = 0 ; i < board[0].length ; i++){
        //placed 
        if(isItSaafe(board ,row , i)){
            board[row][i] = true ;
            Nqueen_2(board , row+1 , tq , qpsf+1 , ans + "{"+ row + "-" + i + "}");
            board[row][i] = false ;
            
        }
    }
    //Not Placed 
    Nqueen_2(board , row+1 , tq , qpsf , ans);
}
public static void main(String[] args) {
Boolean board[][] = new Boolean[4][4];
Nqueen_2(board ,0 , 3 , 0 , "");
}

}
Sir , Please review my code i am getting a null pointer exception and i cant figure out the issue

Error :-
Exception in thread “main” java.lang.NullPointerException
at Main.isItSaafe(Main.java:12)
at Main.Nqueen_2(Main.java:69)
at Main.Nqueen_2(Main.java:71)
at Main.main(Main.java:81)

HEy @rahul1402 You have compared your code with mam’s code?

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.