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

Random image from bundle displayed (or crash) when img has no src #221

Closed
thillerson opened this issue Sep 15, 2012 · 5 comments
Closed

Comments

@thillerson
Copy link
Contributor

If an img tag has no src (src == nil), DTTextAttachment doesn't keep track of that, and tries to find a local image from the bundle, since the scheme is not "data" c.f. DTTextAttachment.m line 112:

NSString *path = [[NSBundle mainBundle] pathForResource:src ofType:nil];

It finds whatever it can find in the bundle, which may be an image, in which case the behavior is strange, or may not be an image, in which case it may crash the app. I experienced a crash when trying to set a nil into the cache.

@thillerson
Copy link
Contributor Author

Sorry, I didn't realize this would create another issue...

odrobnik added a commit that referenced this issue Sep 17, 2012
@odrobnik
Copy link
Collaborator

@thillerson what "another issue" are you talking about?

@thillerson
Copy link
Contributor Author

I meant I didn't realize the pull request would create an issue in Github issues...

@odrobnik
Copy link
Collaborator

each pull request IS an issue. The pull request gets closed by merging it. The original issue needs to be closed either manually or by adding "fixes #221" in the commit message.

@thillerson
Copy link
Contributor Author

Right, I learned that after issuing the pull request. Sorry about that - won't happen again.

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