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

Fix index out of bounds exception on velocity attribute parsing #1120

Merged
merged 1 commit into from
Feb 1, 2023

Conversation

Pablete1234
Copy link
Member

Fixes:

java.lang.StringIndexOutOfBoundsException: String index out of range: 0
	at java.lang.String.charAt(String.java:658) ~[?:1.8.0_352]
	at tc.oc.pgm.regions.RegionFilterApplicationParser.parse(RegionFilterApplicationParser.java:130) ~[?:?]
	at tc.oc.pgm.regions.RegionModule$Factory.parse(RegionModule.java:60) ~[?:?]
	at tc.oc.pgm.regions.RegionModule$Factory.parse(RegionModule.java:34) ~[?:?]
	at tc.oc.pgm.map.MapFactoryImpl.createModule(MapFactoryImpl.java:74) ~[?:?]
	at tc.oc.pgm.map.MapFactoryImpl.createModule(MapFactoryImpl.java:42) ~[?:?]
	at tc.oc.pgm.api.module.ModuleGraph.load(ModuleGraph.java:159) ~[?:?]
	at tc.oc.pgm.api.module.ModuleGraph.loadAll(ModuleGraph.java:47) ~[?:?]
	at tc.oc.pgm.map.MapFactoryImpl.load(MapFactoryImpl.java:112) ~[?:?]
	at tc.oc.pgm.map.MapLibraryImpl.loadMap(MapLibraryImpl.java:213) ~[?:?]
	at tc.oc.pgm.map.MapLibraryImpl.loadMapSafe(MapLibraryImpl.java:240) ~[?:?]
	at tc.oc.pgm.map.MapLibraryImpl.lambda$null$3(MapLibraryImpl.java:179) ~[?:?]
	at java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:183) [?:1.8.0_352]
	at java.util.Spliterators$ArraySpliterator.forEachRemaining(Spliterators.java:948) [?:1.8.0_352]
	at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:482) [?:1.8.0_352]
	at java.util.stream.ForEachOps$ForEachTask.compute(ForEachOps.java:290) [?:1.8.0_352]
	at java.util.concurrent.CountedCompleter.exec(CountedCompleter.java:731) [?:1.8.0_352]
	at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289) [?:1.8.0_352]
	at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056) [?:1.8.0_352]
	at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692) [?:1.8.0_352]
	at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:175) [?:1.8.0_352]

Which occurs when someone has an empty velocity argument in a region, ie: velocity=""

Signed-off-by: Pablo Herrera <pabloherrerapalacio@gmail.com>
@Pablete1234 Pablete1234 added the bug Something isn't working label Feb 1, 2023
@Electroid Electroid merged commit 533edf5 into dev Feb 1, 2023
@Electroid Electroid deleted the fix-velocity-exception branch February 1, 2023 22:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Development

Successfully merging this pull request may close these issues.

2 participants