Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Merge pull request #12 from jstepien/master

Fix a crash by filtering out job adverts
  • Loading branch information...
commit e0e8b0e5abc9b449be144c5312a788987d3cddeb 2 parents 03366f8 + 8782ae8
Amir Mohammad Saied authored June 04, 2011

Showing 1 changed file with 5 additions and 1 deletion. Show diff stats Hide diff stats

  1. 6  src/com/gluegadget/hndroid/Main.java
6  src/com/gluegadget/hndroid/Main.java
@@ -477,6 +477,10 @@ private void refreshNews(String newsUrl) {
477 477
     				if (i < subtexts.length) {
478 478
     					TagNode subtext = (TagNode) subtexts[i];
479 479
     					Object[] scoreSpanNode = subtext.evaluateXPath("/span");
  480
+						if (scoreSpanNode.length == 0)
  481
+							// If there's no span in the subtext it's a job
  482
+							// advert. Skip it.
  483
+							continue;
480 484
     					TagNode score = (TagNode) scoreSpanNode[0];
481 485
     					
482 486
     					Object[] scoreAnchorNodes = subtext.evaluateXPath("/a");
@@ -521,4 +525,4 @@ private void refreshNews(String newsUrl) {
521 525
 
522 526
     	}
523 527
     }
524  
-}
  528
+}

0 notes on commit e0e8b0e

Please sign in to comment.
Something went wrong with that request. Please try again.