add if statement to check whether sampleFiles got any element
Reorganized if Statement
Merge pull request #2355 from theanh0512/treeViewFix

add if statement to check whether sampleFiles got any element