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

IndexOutOfRangeExceptions in 2018.3.x #17

Closed
kersk opened this issue Jan 16, 2019 · 2 comments
Closed

IndexOutOfRangeExceptions in 2018.3.x #17

kersk opened this issue Jan 16, 2019 · 2 comments
Assignees
Labels

Comments

@kersk
Copy link
Contributor

kersk commented Jan 16, 2019

Great asset! However, I hit a minor bug when testing this in 2018.3.x. When entering any text in the console, it would intermittently throw the following IndexOutOfRangeException:

IndexOutOfRangeException: Index was outside the bounds of the array.
uREPL.Completion+<>c__DisplayClass11_0.<Start>b__0 () (at Assets/External/uREPL/Scripts/Core/Completion.cs:44)
System.Threading.ThreadHelper.ThreadStart_Context (System.Object state) (at <ac823e2bb42b41bda67924a45a0173c3>:0)
System.Threading.ExecutionContext.RunInternal (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) (at <ac823e2bb42b41bda67924a45a0173c3>:0)
System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) (at <ac823e2bb42b41bda67924a45a0173c3>:0)
System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state) (at <ac823e2bb42b41bda67924a45a0173c3>:0)
System.Threading.ThreadHelper.ThreadStart () (at <ac823e2bb42b41bda67924a45a0173c3>:0)
UnityEngine.UnhandledExceptionHandler:<RegisterUECatcher>m__0(Object, UnhandledExceptionEventArgs)

I worked around it by modifying Completion.cs @ line 44:

- result_.partialCode = completions[0].prefix : "";
+ result_.partialCode = (completions != null && completions.Length > 0) ? completions[0].prefix : "";

That seems to avoid the issue. Thanks!

@hecomi hecomi self-assigned this Jan 16, 2019
@hecomi hecomi added the bug label Jan 16, 2019
@slimshader
Copy link

Will this be fixed? Is new Release coming?

hecomi added a commit that referenced this issue Mar 30, 2019
@hecomi
Copy link
Owner

hecomi commented Mar 30, 2019

Sorry for my late work..., I've fixed this problem in v0.6.0. Thank you very much for the report.
https://github.com/hecomi/uREPL/releases/tag/v0.6.0

@hecomi hecomi closed this as completed Mar 30, 2019
hecomi added a commit that referenced this issue Aug 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants