The below code produces crashes. It works fine with 10.14 or earlier.
I need the correct Trash path of all volumes. (btw for macOS 10.15 this is called Bin).
for x as integer = 1 to VolumeCount
msgbox SpecialFolder.Trash(Volume(x-1)).NativePath
next
I tried your code. There is no crash and you need to catch the NOE. And some things changed with Catalina. So Volume(0) doesn’t have a trash anymore and you need to code around it.
Could this be related to the fact that macOS 10.15 now has a “read only” System Volume (which most likely doesn’t have a Bin/Trash)…?
I’m sure you have debugged this: Which Volume does crash the app with the code above? Is it some catchable exception (even if another than NilObjectException)?
If it’s indeed the new read-only System Volume, you might just want to exclude that one for now as a workaround…?
[quote=458082:@Christoph De Vocht]The below code produces crashes. It works fine with 10.14 or earlier.
I need the correct Trash path of all volumes. (btw for macOS 10.15 this is called Bin).
for x as integer = 1 to VolumeCount
msgbox SpecialFolder.Trash(Volume(x-1)).NativePath
next
Is this a known issue?[/quote]
I think you have (wrongly) assumed that every volume will have a trash folder. In macOS 10.15 the system partition is read-only so I imagine it won’t have one. The same might also be true for disk images / CD & DVD volumes.
You should really be checking that SpecialFolder.Trash(Volume(x-1)) is not Nil before trying to access any of its properties.