Fix javascript error on settings save failure

Change-Id: Ieb4273d8b3d35722a4da9e647b6ae6f08eff8bf9
Merge "Fix javascript error on settings save failure"