Fixed NullPointer issue on new/edit dialog