Success! Looks like we've fixed this one. According to our records the fix was applied for TOUCH-1660 in a recent build.
  1. #1
    Sencha User aflx's Avatar
    Join Date
    Jun 2011
    Location
    Berlin, Germany
    Posts
    64
    Vote Rating
    0
    aflx is on a distinguished road

      0  

    Default Problem with onHistoryChange

    Problem with onHistoryChange


    Hi there,

    I'm migrating from PR3 to PR4. Now I have a problem with the new history feature.
    I'm not using any routes which causes a NPE if the history/url changes.

    The application will trigger a change in the onHistoryChange-event here (in Ext.app.Application):

    Code:
    onHistoryChange: function(url) {
        this.dispatch(this.getRouter().recognize(url), false);
    }
    The problem is, that recognize() returns undefined, if the url is not found, which causes a NPE in the dispatch function because the first parameter (action) is null/undefined!

    Code:
    dispatch: function(action, addToHistory) {
          action = Ext.factory(action, Ext.app.Action);
    
          var profile    = this.getCurrentProfile(),
                profileNS  = profile ? profile.getNamespace() : undefined,
                controller = this.getController(action.getController(), profileNS);
    
          if (controller) {
                if (addToHistory !== false) {
                    this.getHistory().add(action, true);
                }
    
                controller.execute(action);
          }
    },
    Can you please have a look at it? I think the NPE should be catched. Or do I have to define routes?

    Best regards,
    Alex

  2. #2
    Sencha User Jamie Avins's Avatar
    Join Date
    Mar 2007
    Location
    Redwood City, California
    Posts
    3,661
    Vote Rating
    20
    Jamie Avins is a jewel in the rough Jamie Avins is a jewel in the rough Jamie Avins is a jewel in the rough

      0  

    Default


    Absolutely, we'll do more rigorous checking there.

    Sencha Inc

    Jamie Avins

    @jamieavins

  3. #3
    Sencha - Community Support Team edspencer's Avatar
    Join Date
    Jan 2009
    Location
    Palo Alto, California
    Posts
    1,939
    Vote Rating
    9
    edspencer is a jewel in the rough edspencer is a jewel in the rough edspencer is a jewel in the rough

      0  

    Default


    Thanks for the report, this is already fixed in latest, will function correctly in the next release
    Ext JS Senior Software Architect
    Personal Blog: http://edspencer.net
    Twitter: http://twitter.com/edspencer
    Github: http://github.com/edspencer

Thread Participants: 2