catch some db query exceptions
This commit is contained in:
		
							parent
							
								
									7617a19280
								
							
						
					
					
						commit
						25c49d5e34
					
				| @ -104,15 +104,17 @@ public class FileUtils { | ||||
| 		}; | ||||
| 
 | ||||
| 		try { | ||||
| 			cursor = context.getContentResolver().query(uri, projection, selection, selectionArgs, | ||||
| 					null); | ||||
| 			cursor = context.getContentResolver().query(uri, projection, selection, selectionArgs,null); | ||||
| 			if (cursor != null && cursor.moveToFirst()) { | ||||
| 				final int column_index = cursor.getColumnIndexOrThrow(column); | ||||
| 				return cursor.getString(column_index); | ||||
| 			} | ||||
| 		} catch(Exception e) { | ||||
| 			return null; | ||||
| 		} finally { | ||||
| 			if (cursor != null) | ||||
| 			if (cursor != null) { | ||||
| 				cursor.close(); | ||||
| 			} | ||||
| 		} | ||||
| 		return null; | ||||
| 	} | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user
	 Daniel Gultsch
						Daniel Gultsch