You may or may not aware that windows 11 has a protection that is called Randsom ware protection (Windows 10 has a similar protection but not the same).
This blocks programs to write (and sometimes read) files on certain default folders (and more if the user has added custom folders too).
If you try to access those folders when this protection is enabled, you will get a NilObjectException crash (that cannot be catched). Even just linking it to a FolderItem will result in a crash.
These are the the default folders:
c:\Users\<username>\Documents
c:\Users\Public\Documents
c:\Users\<username>\Pictures
c:\Users\Public\Pictures
c:\Users\Public\Videos
c:\Users\<username>\Videos
c:\Users\<username>\Music
c:\Users\Public\Music
c:\Users\<username>\Favorites
So keep that in mind.
Also, atm this protection is disabled by default. But I did read Microsoft are considering this to be enabled by default.
On a side note: maybe Xojo Inc could add a way to catch the NilObjectException.
Ransomware protection. Both Win 10 and Win 11 have it.
I donât get it. Things like these always worked:
Var nilFolder As FolderItem
Try
MessageBox nilFolder.Exists.ToString // Nil Object Exception
Catch e As NilObjectException
MessageBox "NOE was catched"
End
break
So is there a case where trying to access user\Documents or user\Desktop or user\AppData\Roaming for example, results in an NOE? Or is it always an I/O Exception? I have an NOE issues that only affects certain users (who I think may all be on Windows 11) and am wondering if it could be related.
Yes, I understood that, but your original post said that it resulted in a NilObjectException, but your example screenshot showed an IOException, so Iâm asking if an NOE ever does in fact occur.