Programs do not crash any more if no folder is chosen by the user. Output: "No folder was chosen".

This was done by a try+catch & if-condition that checks if the folder is null.