neo09 / gwt-platform

Automatically exported from code.google.com/p/gwt-platform
0 stars 0 forks source link

ArrayIndexOutOfBoundsException on "#/" historyTokens #181

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. User incorrectly enters page.html#/

What is the expected output? What do you see instead?
Default/Error page should be revealed in response to no presenter being 
assigned the name token.

However since "/" is the default separator, it is stripped out of the
historytoken and the placeHeirarchy.get(placeHierarchy.size() - 1)
fails with ArrayIndexOutOfBoundsException

A simple fix 

 @Override
 public PlaceRequest getCurrentPlaceRequest() {
     try {
         return placeHierarchy.get(placeHierarchy.size() - 1);
     } catch (ArrayIndexOutOfBoundsException e){
         return new PlaceRequest();
     }
 }

Original issue reported on code.google.com by thagriz...@gmail.com on 28 Aug 2010 at 10:50

GoogleCodeExporter commented 9 years ago
Thanks a lot! Who should we credit this fix to in the AUTHOR file?

Original comment by philippe.beaudoin on 28 Aug 2010 at 11:50

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Thanks again for the patch!

Original comment by philippe.beaudoin on 31 Aug 2010 at 11:22