Skip to content
This repository has been archived by the owner on Jan 18, 2025. It is now read-only.

Crash when parsing certain page #11

Closed
fraserscottmorrison opened this issue Jul 13, 2016 · 1 comment
Closed

Crash when parsing certain page #11

fraserscottmorrison opened this issue Jul 13, 2016 · 1 comment

Comments

@fraserscottmorrison
Copy link
Contributor

Hiya,

Ive encountered a crash which occurs when parsing this link http://go.acgedu.com/acg-parnellcollege/

Ive resolved it by putting a check that it can substring but this probably isn't addressing the root of the issue (maybe caused by the pages title being a url?)

    // Extract matches from string
    static func stringMatches(results: [NSTextCheckingResult], text: String, index: Int = 0) -> [String] {

        return results.map {
            let range = $0.rangeAtIndex(index)
            if text.characters.count > range.location + range.length {
                return (text as NSString).substringWithRange(range)
            }
            else {
                return ""
            }
        }
    }
@LeonardoCardoso
Copy link
Owner

Hi, @fraserscottmorrison! Thanks. Can you do a PR?!

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

No branches or pull requests

2 participants