Bug fix: null exception during edit