Merge change I0d74deb6 into eclair

* changes:
  Fix possible NPE in the code that restores widgets' state.