Skip to content

React Pacakger server - getBoolOptionFromQuery error #218

@imaffett

Description

@imaffett

Using the starter app, the node server fails. I'd submit a fix, but can't sign the CLA right now.

TypeError: Cannot read property 'dev' of null
    at getBoolOptionFromQuery (/Users/idmaffet/react-native/IanTest/node_modules/react-native/packager/react-packager/src/Server/index.js:276:12)

It's an easy fix - just modify the if statement to check if the query object exists

function getBoolOptionFromQuery(query, opt, defaultVal) {
   if (!query||(query[opt] == null && defaultVal != null)) {
     return defaultVal;
   }

  return query[opt] === 'true' || query[opt] === '1';
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions