-
28 Jan 2012 7:30 AM #1
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):
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:onHistoryChange: function(url) { this.dispatch(this.getRouter().recognize(url), false); }
Can you please have a look at it? I think the NPE should be catched. Or do I have to define routes?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); } },
Best regards,
Alex
-
28 Jan 2012 8:33 AM #2Sencha - Sencha Touch Dev Team
- Join Date
- Mar 2007
- Location
- Redwood City, California
- Posts
- 3,653
- Vote Rating
- 14
Absolutely, we'll do more rigorous checking there.
-
28 Jan 2012 11:02 AM #3Sencha - Community Support Team
- Join Date
- Jan 2009
- Location
- Palo Alto, California
- Posts
- 1,941
- Vote Rating
- 6
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
Success! Looks like we've fixed this one. According to our records the fix was applied for
TOUCH-1660
in
2.0.


Reply With Quote