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

Minor Bug: Fix error on accessing empty releaseRecordForConstraints var #7276

Merged
merged 1 commit into from Jun 23, 2016

Conversation

Projects
None yet
2 participants
@TomFreudenberg
Contributor

TomFreudenberg commented Jun 23, 2016

Minor bug from 4commerce-technologies-AG#49:

When running meteor from checkout (as we do for the ARM fork) and use meteor update or meteor update --packages-only you will get following error:

packages/promise/.npm/package/node_modules/meteor-promise/promise_server.js:165
      throw error;
            ^
TypeError: Cannot read property 'packages' of null
    at Command.main.registerCommand.name [as func] (/tools/cli/commands-packages.js:1721:12)
    at /tools/cli/main.js:1402:23

Steps to reproduce:

cd /tmp

git clone -b release/METEOR@1.3.4 https://github.com/meteor/meteor.git meteor-checkout

meteor-checkout/meteor create hello-world

cd hello-world

../meteor-checkout/meteor update

Reason

When running meteor update from checkout the var releaseRecordForConstraints ist set to null in case of if (!files.inCheckout()) - see source lines

It will not get checked later, that this var is null and accessing the instance attribute raise an exception - see source line.

Proposal

As a proposal I add a check before accessing the null instance.

Thanks for feedback or merge
Tom

Fix error on accessing empty releaseRecordForConstraints var
	When running meteor from checkout this var is defined to be null.
	Accessing var instance attribute will raise an exception
@benjamn

This comment has been minimized.

Member

benjamn commented Jun 23, 2016

This seems safe to me, since it's always possible that releaseRecordForConstraints.packages is empty, which leads to the same behavior (no constraints added).

@benjamn benjamn merged commit 4d145b6 into meteor:devel Jun 23, 2016

3 checks passed

CLA Author has signed the Meteor CLA.
Details
ci/circleci Your tests passed on CircleCI!
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@TomFreudenberg

This comment has been minimized.

Contributor

TomFreudenberg commented Jun 23, 2016

Cool - thanks for merging again

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment