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

LectureFormatter crash on "Understanding Einstein: The Special Theory of Relativity" #2

Open
cshung opened this issue Aug 9, 2013 · 2 comments

Comments

@cshung
Copy link

cshung commented Aug 9, 2013

The lecture url to the course is https://class.coursera.org/einstein-001/lecture/index

The root cause of the crash is

cn.ChildNodes.First(ccn => ccn.Name == "div").ChildNodes.First(ccn => ccn.Attributes["title"] != null && ccn.Attributes["title"].Value == "Video (MP4)").Attributes["href"].Value;

while

cn.ChildNodes.First(ccn => ccn.Name == "div").ChildNodes.First(ccn => ccn.Attributes["title"] != null && ccn.Attributes["title"].Value == "Video (MP4)") is null for the first course.

For unknown reason - the website don't have a link to the 1st video.

Just check null before moving on would have the issue solved. But I would like the navigation of the DOM more defensive.

@CrshOverride
Copy link
Owner

Sorry about the delayed response. I was out of the country without access.

I agree, there are several places that need to be more defensively coded. I wrote everything in a hurry as I was trying to build a proof of concept Windows Phone app and never went back to clean up the code. I should be able to make the updates shortly.

I would also appreciate it if you could save and then zip that page and email it me. The more examples of Coursera's markup I have, the better I can make the code.

@cshung
Copy link
Author

cshung commented Aug 14, 2013

The zip file is attached.

Let's try this one, that can save you some time checking null everywhere.

http://www.codeproject.com/Articles/109026/Chained-null-checks-and-the-Maybe-monad
I built a Windows Store app with your library, maybe we can cross reference
each other when we sell it :)

Thanks,
Andrew
On Mon, Aug 12, 2013 at 8:09 AM, Justin Niessner
[email protected]:

Sorry about the delayed response. I was out of the country without access.

I agree, there are several places that need to be more defensively coded.
I wrote everything in a hurry as I was trying to build a proof of concept
Windows Phone app and never went back to clean up the code. I should be
able to make the updates shortly.

I would also appreciate it if you could save and then zip that page and
email it me. The more examples of Coursera's markup I have, the better I
can make the code.


Reply to this email directly or view it on GitHubhttps://github.com//issues/2#issuecomment-22500040
.

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