Author: jerome
Date: 2009-07-08 13:27:33 +0200 (Wed, 08 Jul 2009)
New Revision: 5084

Modified:
   
software_suite_v3/software/plugin/plugin-programsTv/trunk/plugin-programsTv/src/com/kysoh/tvPrograms/programs/SimplePrograms.java
Log:
* Give error message in case of Date update error.

Modified: 
software_suite_v3/software/plugin/plugin-programsTv/trunk/plugin-programsTv/src/com/kysoh/tvPrograms/programs/SimplePrograms.java
===================================================================
--- 
software_suite_v3/software/plugin/plugin-programsTv/trunk/plugin-programsTv/src/com/kysoh/tvPrograms/programs/SimplePrograms.java
   2009-07-08 10:48:49 UTC (rev 5083)
+++ 
software_suite_v3/software/plugin/plugin-programsTv/trunk/plugin-programsTv/src/com/kysoh/tvPrograms/programs/SimplePrograms.java
   2009-07-08 11:27:33 UTC (rev 5084)
@@ -195,6 +195,7 @@
                else
                {
                        this.triggerError();
+                       return new Vector<Program>();
                }
                
                return programs;
@@ -236,24 +237,33 @@
                //Getting web link.
                for (String str : spl)
                {
+                       if(str == null)
+                               return null;
+                       
                        if((str.length() > 0) && (!str.contains("</b><p>")) && 
(!str.contains("</B><p>")) && (!str.contains("http://";)))
                        {
-                               String day = str.substring(str.indexOf("\">") + 
2, str.indexOf(" "));
-                               String dMonth = str.substring(str.indexOf(day) 
+ day.length() + 1);
-                               
-                               dMonth = dMonth.substring(0, dMonth.indexOf(" 
"));
-                               
-                               if(Integer.valueOf(dMonth).intValue() == 
currentNDay)
+                               try
                                {
-                                       try
+                                       String day = 
str.substring(str.indexOf("\">") + 2, str.indexOf(" "));
+                                       String dMonth = 
str.substring(str.indexOf(day) + day.length() + 1);
+                                       dMonth = dMonth.substring(0, 
dMonth.indexOf(" "));
+                                       if(Integer.valueOf(dMonth).intValue() 
== currentNDay)
                                        {
-                                               return 
HTMLUtils.getPage(this.url, str.substring(0, str.indexOf("\">")));
+                                               try
+                                               {
+                                                       return 
HTMLUtils.getPage(this.url, str.substring(0, str.indexOf("\">")));
+                                               }
+                                               
catch(StringIndexOutOfBoundsException error)
+                                               {
+                                                       this.triggerError();
+                                               }
                                        }
-                                       catch(StringIndexOutOfBoundsException 
error)
-                                       {
-                                               error.printStackTrace();
-                                       }
                                }
+                               catch(StringIndexOutOfBoundsException dateError)
+                               {
+                                       this.triggerError();
+                                       return null;
+                               }
                        }
                }
                


------------------------------------------------------------------------------
Enter the BlackBerry Developer Challenge  
This is your chance to win up to $100,000 in prizes! For a limited time, 
vendors submitting new applications to BlackBerry App World(TM) will have
the opportunity to enter the BlackBerry Developer Challenge. See full prize  
details at: http://p.sf.net/sfu/Challenge
_______________________________________________
Tux-droid-svn mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tux-droid-svn

Reply via email to