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

Ensure file exist before checking segment #65

Merged
merged 1 commit into from
Oct 12, 2017
Merged

Ensure file exist before checking segment #65

merged 1 commit into from
Oct 12, 2017

Conversation

manawasp
Copy link
Contributor

Hello, attempt to fix #59.

Context: First thing, the link which generate the error is /products/desktop/11/release-notes/#low-quality ~ l.3032 from @miltador.

Process: htmltest will enter to the method checkInternalHash then to refDoc, _ := hT.documentStore.ResolveRef(ref) which return nil, false because there is no match (method func (dS *DocumentStore) ResolvePath(refPath string) (*Document, bool) ), but methods are called from the struct and one of them try to acces to one of these properties as the mutex, and panic.

Fix: To prevent this error I suggest to check segment only if the file exist

note: naming segment would be not better than hash in checkInternalHash ?

@codecov-io
Copy link

codecov-io commented Oct 11, 2017

Codecov Report

Merging #65 into master will increase coverage by 0.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #65      +/-   ##
==========================================
+ Coverage   95.67%   95.69%   +0.01%     
==========================================
  Files          17       17              
  Lines         902      905       +3     
==========================================
+ Hits          863      866       +3     
  Misses         34       34              
  Partials        5        5
Impacted Files Coverage Δ
htmltest/check-link.go 95.16% <100%> (+0.05%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d42cbee...730c933. Read the comment docs.

Copy link
Owner

@wjdp wjdp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fantastic, thanks for this!

@wjdp wjdp merged commit af7a7d3 into wjdp:master Oct 12, 2017
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

Successfully merging this pull request may close these issues.

segfault in Document.Parse htmlMutex
3 participants