akorb / SteamShutdown

Automatic shutdown after Steam download(s) has finished.
MIT License
362 stars 28 forks source link

v1.5 Crash on startup #7

Closed F0x06 closed 7 years ago

F0x06 commented 7 years ago

Hi, i have the following exception (sorry for the french sections, i'm french), thank you !

OS: Windows 10 x64

System.TypeInitializationException: Une exception a été levée par l'initialiseur de type pour 'SteamShutdown.Steam'. ---> Microsoft.CSharp.RuntimeBinder.RuntimeBinderException: Impossible d'effectuer une liaison au moment de l'exécution sur une référence null
   à CallSite.Target(Closure , CallSite , Object )
   à System.Dynamic.UpdateDelegates.UpdateAndExecute1[T0,TRet](CallSite site, T0 arg0)
   à CallSite.Target(Closure , CallSite , Object )
   à SteamShutdown.Steam.JsonToAppInfo(Object json)
   à System.Dynamic.UpdateDelegates.UpdateAndExecute2[T0,T1,TRet](CallSite site, T0 arg0, T1 arg1)
   à CallSite.Target(Closure , CallSite , Type , Object )
   à SteamShutdown.Steam.UpdateAppInfos()
   à SteamShutdown.Steam..cctor()
   --- Fin de la trace de la pile d'exception interne ---
   à SteamShutdown.Steam.get_Apps()
   à SteamShutdown.Main..ctor()
   à SteamShutdown.Program.Main()
F0x06 commented 7 years ago

I fixed the bug, i have an empty acf manifest for unknown reasons in one of my libraries (Rust AppID: 252490).

akorb commented 7 years ago

Thank you very much. I added one more commit. I don't know whether the file size of the acf file is actually 0. Could you please check whether my last commit breaks the fix? 1da559116c5ba6a56ce6e14460dd5e884050d950

F0x06 commented 7 years ago

No problem :), based on your code i just read, it will work , I will test ASAP.

F0x06 commented 7 years ago

@akorb

Works only for the empty file bug, see #9 i added a check for NULL bytes corrupted files also.

akorb commented 7 years ago

Thank you very much. I think about adding some tests. Could you attach the acf file please? I guess that's a good step to start

F0x06 commented 7 years ago

Hi ! :) Nice idea about tests suite.

I attached the file (renamed to .acf.txt due to github files policy)

appmanifest_252490.acf.txt

akorb commented 7 years ago

Thank you very much. I added your commit with some changes. 6e4026e7631e8fd8c8ab406a4b4e08e7a804dd9f

I will publish a new release next week