Fix NPE when changing a setting fails

Change-Id: I02bf7a39714d5a0d657c66a1d02c831a76014000