Merge "Protect against NPE when updating state" into udc-dev