There is something wrong with your logic. If it is equal to null, but you want to get its absolute path, even if no error is reported, it must be NullPointException.
Think more about it yourself when encountering this kind of problem. This is obviously a grammatical error. You can see the cause of the error by placing your cursor on the red wavy line.
The code here will never be executed, so the editor reminds you that this is dead code
The File type returned by getAbsoluteFile() is not String, so it should
There is something wrong with your logic. If it is equal to null, but you want to get its absolute path, even if no error is reported, it must be
NullPointException
.Think more about it yourself when encountering this kind of problem. This is obviously a grammatical error. You can see the cause of the error by placing your cursor on the red wavy line.