#4356: Added checking if file selected & bug fix

Bug about selecting nothing (caused error)