Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

0-byte icon files can hang loading #69

Closed
JonnyOThan opened this issue Jul 27, 2022 · 1 comment
Closed

0-byte icon files can hang loading #69

JonnyOThan opened this issue Jul 27, 2022 · 1 comment
Labels
kspBug Identified KSP issue

Comments

@JonnyOThan
Copy link
Contributor

JonnyOThan commented Jul 27, 2022

I was helping someone on discord with their game which was hanging on load. The last thing in the logs is:

7993 [LOG 01:11:43.532] Load(Texture): SquadExpansion/MakingHistory/Parts/@thumbs/kv2Pod_icon
7994 [EXC 01:11:43.535] NullReferenceException: Object reference not set to an instance of an object
7995     KSPCommunityFixes.TextureLoaderOptimizations+<GetEnumerator>d__32.MoveNext () (at <0bab5addef684db2b081bb849763d334>:0)
7996     UnityEngine.SetupCoroutine.InvokeMoveNext (System.Collections.IEnumerator enumerator, System.IntPtr returnValueAddress) (at <12e76cd50cc64cf19e759e981cb725af>:0)
7997     UnityEngine.DebugLogHandler:LogException(Exception, Object)
7998     ModuleManager.UnityLogHandle.InterceptLogHandler:LogException(Exception, Object)
7999     UnityEngine.Debug:CallOverridenDebugHandler(Exception, Object)

I'm not sure what was wrong with this file - I've seen other reports that occasionally the png files are 0 bytes long (possibly due to a crash/shutdown while generating them?). But in any case this function probably needs to be hardened against exceptions.

Update: confirmed that the file in question was 0 bytes, but not how it got like that.

@JonnyOThan
Copy link
Contributor Author

huh, seems like the stock game also barfs on this, so maybe worth patching that too?

5254 [LOG 13:44:17.346] Load(Texture): SquadExpansion/MakingHistory/Parts/@thumbs/kv2Pod_icon
5255 [EXC 13:44:17.352] NullReferenceException: Object reference not set to an instance of an object
5256     DatabaseLoaderTexture_PNG+<Load>d__0.MoveNext () (at <39c0323fb6b449a4aaf3465c00ed3c8d>:0)
5257     UnityEngine.SetupCoroutine.InvokeMoveNext (System.Collections.IEnumerator enumerator, System.IntPtr returnValueAddress) (at <12e76cd50cc64cf19e759e981cb725af>:0)
5258     UnityEngine.DebugLogHandler:LogException(Exception, Object)
5259     ModuleManager.UnityLogHandle.InterceptLogHandler:LogException(Exception, Object)
5260     UnityEngine.Debug:CallOverridenDebugHandler(Exception, Object)

@JonnyOThan JonnyOThan changed the title TextureConversion feature can hang loading 0-byte icon files can hang loading Jul 27, 2022
@gotmachine gotmachine added the kspBug Identified KSP issue label Aug 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kspBug Identified KSP issue
Development

No branches or pull requests

2 participants