Just `if (path.isEmpty())` will be enough, it's never NULL