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

0.8 stable test #22253

Closed
wants to merge 10 commits into from
Prev Previous commit
Next Next commit
[ReactNative] Fix crash in ListView
  • Loading branch information
sahrens authored and ide committed Jul 16, 2015
commit d4af94826112e94544bbb0c48bebdc39ff40e2ad
7 changes: 6 additions & 1 deletion Libraries/CustomComponents/ListView/ListView.js
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,9 @@ var ListView = React.createClass({
* such as scrollTo.
*/
getScrollResponder: function() {
return this.refs[SCROLLVIEW_REF].getScrollResponder();
return this.refs[SCROLLVIEW_REF] &&
this.refs[SCROLLVIEW_REF].getScrollResponder &&
this.refs[SCROLLVIEW_REF].getScrollResponder();
},

setNativeProps: function(props) {
Expand Down Expand Up @@ -400,6 +402,9 @@ var ListView = React.createClass({

_measureAndUpdateScrollProps: function() {
var scrollComponent = this.getScrollResponder();
if (!scrollComponent || !scrollComponent.getInnerViewNode) {
return;
}
RCTUIManager.measureLayout(
scrollComponent.getInnerViewNode(),
React.findNodeHandle(scrollComponent),
Expand Down
4 changes: 2 additions & 2 deletions Libraries/Utilities/MessageQueue.js
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,8 @@ class MessageQueue {
let callback = this._callbacks[cbID];
if (__DEV__) {
let debug = this._debugInfo[cbID >> 1];
let module = this._remoteModuleTable[debug[0]];
let method = this._remoteMethodTable[debug[0]][debug[1]];
let module = debug && this._remoteModuleTable[debug[0]];
let method = debug && this._remoteMethodTable[debug[0]][debug[1]];
if (!callback) {
console.error(`Callback with id ${cbID}: ${module}.${method}() not found`);
} else if (SPY_MODE) {
Expand Down