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

Commit with no function causes it to blow up #170

Open
jrgleason opened this issue Sep 10, 2015 · 1 comment
Open

Commit with no function causes it to blow up #170

jrgleason opened this issue Sep 10, 2015 · 1 comment

Comments

@jrgleason
Copy link

I have code that uses transactions. It adds a bunch of nodes, however, when everything is done there are no side effects so I tried the following..

transaction.commit();

This blows up saying the function is undefined but this...

transaction.commit(function(){});

Works fine, maybe we should use a quick null check to see if it needs called.

@aseemk aseemk added this to the v2 redesign milestone Oct 12, 2015
@aseemk
Copy link
Member

aseemk commented Oct 12, 2015

Sorry for the delay here, but good point — thanks for filing.

I hear you that we could simply check if the function is given first. But I think it's best practice to always require a callback (and not to send a no-op one), in case there are any errors.

So maybe it'd be better for us to check for and require a callback right away?

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

No branches or pull requests

2 participants