Why this code is not working on the nodes which are not present case

@codingblockscpp
Please give the test case for which the code failed