first check if file exists before checking the files size

cc @Raydiation @icewind1991 this should solve the issue with the notes app. Please give it a try and review it. Thanks!