return null, not empty list, when nothing found

This commit is contained in:
Andy2 2010-10-19 07:49:54 -07:00
parent f31e28dbd7
commit 994a73e28b

View file

@ -180,6 +180,7 @@ public class DBUtils {
public static String[] getRelayIDNoMsgs( Context context ) public static String[] getRelayIDNoMsgs( Context context )
{ {
String[] result = null;
initDB( context ); initDB( context );
ArrayList<String> ids = new ArrayList<String>(); ArrayList<String> ids = new ArrayList<String>();
@ -207,7 +208,11 @@ public class DBUtils {
cursor.close(); cursor.close();
db.close(); db.close();
} }
return ids.toArray( new String[ids.size()] );
if ( 0 < ids.size() ) {
result = ids.toArray( new String[ids.size()] );
}
return result;
} }
private static void initDB( Context context ) private static void initDB( Context context )