fix null-dereference bug in SampleEditView