Fixed NullPointerException if no folder was chosen.