Skip to content

Crash when folder contains invalid shortcut #7284

Closed
@BanCrash

Description

@BanCrash

Description

When I enter my Images folder, Files will crash. I've tested another folders but this is the only one where I got the crash.

I cleaned the log to only have the relevant:

debug.log:

2021-12-13 18:29:51.4576|ERROR|AppUnhandledException|Object reference not set to an instance of an object.
	System.NullReferenceException: Object reference not set to an instance of an object.
   at Files.Filesystem.StorageEnumerators.Win32StorageEnumerator.<GetFile>d__4.MoveNext() + 0xe6b
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() + 0x21
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task) + 0x70
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task) + 0x38
   at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task) + 0x17
   at Files.Filesystem.StorageEnumerators.Win32StorageEnumerator.<ListEntries>d__2.MoveNext() + 0x2cb
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() + 0x21
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task) + 0x70
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task) + 0x38
   at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task) + 0x17
   at Files.ViewModels.ItemViewModel.<>c__DisplayClass142_1.<<EnumerateItemsFromStandardFolderAsync>b__4>d.MoveNext() + 0x29a
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() + 0x21
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task) + 0x70
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task) + 0x38
   at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task) + 0x17
   at System.Runtime.CompilerServices.TaskAwaiter.GetResult() + 0xb
   at Files.ViewModels.ItemViewModel.<EnumerateItemsFromStandardFolderAsync>d__142.MoveNext() + 0x6f6
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() + 0x21
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task) + 0x70
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task) + 0x38
   at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task) + 0x17
   at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult() + 0xf
   at Files.ViewModels.ItemViewModel.<RapidAddItemsToCollection>d__138.MoveNext() + 0x20d
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() + 0x21
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task) + 0x70
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task) + 0x38
   at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task) + 0x17
   at System.Runtime.CompilerServices.TaskAwaiter.GetResult() + 0xb
   at Files.ViewModels.ItemViewModel.<RapidAddItemsToCollectionAsync>d__137.MoveNext() + 0x509
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() + 0x21
   at System.Runtime.CompilerServices.AsyncMethodBuilderCore.<>c.<ThrowAsync>b__7_0(Object) + 0x1e
   at System.Action`1.Invoke(T) + 0x28
   at System.Threading.WinRTSynchronizationContext.Invoker.InvokeCore() + 0x33
   at System.Runtime.InteropServices.McgMarshal.ThrowOnExternalCallFailed(Int32, RuntimeTypeHandle) + 0x21
   at __Interop.ComCallHelpers.Call(__ComObject, RuntimeTypeHandle, Int32) + 0xb8
   at __Interop.ForwardComStubs.Stub_10[TThis](__ComObject, Int32) + 0x24
   at Microsoft.AppCenter.Utils.ApplicationLifecycleHelper.<.ctor>b__17_1(Object, UnhandledErrorDetectedEventArgs) + 0x3d
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() + 0x21
   at Microsoft.AppCenter.Utils.ApplicationLifecycleHelper.<.ctor>b__17_1(Object, UnhandledErrorDetectedEventArgs) + 0x75
   at System.EventHandler`1.Invoke(Object, TEventArgs) + 0x2e
   at __Interop.Intrinsics.HasThisCall__23[TArg0](Object, IntPtr, Object, TArg0) + 0x36
   at Files!<BaseAddress>+0x13a84c0

debug_fulltrust.log

2021-12-13 18:29:49.0209|WARN|StartSTATask|El sistema no puede encontrar el archivo especificado. (0x80070002)
	System.IO.FileNotFoundException: El sistema no puede encontrar el archivo especificado. (0x80070002)
   at Vanara.PInvoke.HRESULT.ThrowIfFailed(String message)
   at Vanara.PInvoke.Shell32.ShellUtil.GetShellItemForPath(String path)
   at Vanara.Windows.Shell.ShellItem..ctor(String path)
   at FilesFullTrust.Win32API.GetFileIconAndOverlay(String path, Int32 thumbnailSize, Boolean getOverlay, Boolean onlyGetOverlay)
   at FilesFullTrust.MessageHandlers.Win32MessageHandler.<>c__DisplayClass3_0.<ParseArgumentsAsync>b__1()
   at FilesFullTrust.Win32API.<>c__DisplayClass0_0`1.<StartSTATask>b__0()

2021-12-13 18:29:51.0675|WARN|ParseFileOperationAsync|Error HRESULT E_FAIL has been returned from a call to a COM component.
	System.Runtime.InteropServices.COMException (0x80004005): Error HRESULT E_FAIL has been returned from a call to a COM component.
   at Vanara.PInvoke.Shell32.IShellLinkW.Resolve(HWND hwnd, SLR_FLAGS fFlags)
   at Vanara.Windows.Shell.ShellLink.LoadAndResolve(String linkFile, SLR_FLAGS resolveFlags, HWND hWin, UInt16 timeOut)
   at Vanara.Windows.Shell.ShellLink..ctor(String linkFile, LinkResolution resolveFlags, IWin32Window window, TimeSpan timeOut)
   at FilesFullTrust.MessageHandlers.FileOperationsHandler.ParseFileOperationAsync(PipeStream connection, Dictionary`2 message)

Steps To Reproduce

  1. Go to Images folder (I don't know if this is related to Crash when attempting to open some libraries #4764, maybe yes)
  2. The app will crash.

Expected behavior

Not crashing

Files Version

Versión: 2.0.42.0 OS Version: 10.0.19044.1387

Windows Version

Windows 10 21H2 19044.1387

Relevant Assets/Logs

debug_fulltrust.log
debug.log

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions