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

NullPointer possible #18

Open
svenjeppsson opened this issue Jan 23, 2019 · 0 comments
Open

NullPointer possible #18

svenjeppsson opened this issue Jan 23, 2019 · 0 comments

Comments

@svenjeppsson
Copy link

Hey found this peace of code where something confuses me.

go-hbci/client/client.go

Lines 153 to 163 in 180d831

for _, unmarshaledSegment := range accountTransactionResponses {
seg := unmarshaledSegment.(segment.AccountTransactionResponse)
accountTransactions = append(accountTransactions, seg.Transactions()...)
if seg != nil {
go func() {
responses <- resFn(c.AccountTransactions(account, timeframe, allAccounts, continuationReference))
}()
} else {
responses <- resFn([]domain.AccountTransaction{}, nil)
}
}

In line 156 checks whether seq is nil but in line 155 seq is already accessed "seg.Transactions()..."

I am still new to golang. In Java line 155 would produce a nullpointerexception when seq is null.
Isen't it the same in go?

svenjeppsson pushed a commit to svenjeppsson/go-hbci that referenced this issue Jan 24, 2019
svenjeppsson pushed a commit to svenjeppsson/go-hbci that referenced this issue Jan 25, 2019
svenjeppsson pushed a commit to svenjeppsson/go-hbci that referenced this issue Jan 29, 2019
svenjeppsson pushed a commit to svenjeppsson/go-hbci that referenced this issue Feb 3, 2019
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

1 participant