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

Cannot read property 'text' of null #13

Open
christianbundy opened this issue Jul 13, 2020 · 3 comments
Open

Cannot read property 'text' of null #13

christianbundy opened this issue Jul 13, 2020 · 3 comments

Comments

@christianbundy
Copy link
Contributor

I tried running invite(groupId, inviteList, null) and my null was treated like an object.

Workaround: Pass empty object.

    not ok 11 - Cannot read property 'text' of null
      ---
      stack: |
        groupInvite (node_modules/ssb-tribes/method/group/add-member.js:26:14)
        Timeout._onTimeout (node_modules/ssb-tribes/method/index.js:21:54)
      at:
        line: 26
        column: 14
        file: node_modules/ssb-tribes/method/group/add-member.js
        function: groupInvite
      type: TypeError
      tapCaught: uncaughtException
      test: async
      source: |2
      
            if (opts.text) content.text = opts.text
        -------------^
      
            if (!isValid(content)) return cb(new Error(isValid.errorsString))
      ...
@mixmix
Copy link
Member

mixmix commented Aug 27, 2020

hmmm why you put null in there?

@christianbundy
Copy link
Contributor Author

I wanted to pass a callback but I didn't want to pass opts. I suppose I could've passed undefined or {}, but usually I'd expect that you could pass null there too. 🤷 Very possible that my expectation is Wrong.

@mixmix
Copy link
Member

mixmix commented Aug 28, 2020

my ideal is to change all the functions so opts can just straight be left out .... as if it's opts it's optional?

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

No branches or pull requests

2 participants