Object reference not set to an instance of an object. at Microsoft.SharePoint.Publishing.Internal.CodeBehind.AreaNavigationSettingsPage.OKButton_Click(Object sender, EventArgs e) error in AreaNavigationSettings.aspx page

Hi,

Was getting the above issue while trying to configure navigation for the SharePoint Site. Tried out different solutions mentioned in the following post.

Corrected the JavaScript issue on the page, renamed the id of the div to something else instead of container but that didn’t work. Then through PowerShell script deleted few of the navigation links and again gave it a try. This time it worked properly.

I think the navigation page would have got corrupted or something because of those links and hence deleting those links fixed the issue.