tolerate empty result set when retrieving first row (e.g. for getting header information)
This commit is contained in:
		
							parent
							
								
									78bdb5f6d0
								
							
						
					
					
						commit
						3beae86d4d
					
				
					 1 changed files with 3 additions and 1 deletions
				
			
		|  | @ -83,7 +83,9 @@ class ResultSet(object): | ||||||
|         return iter(self.result) |         return iter(self.result) | ||||||
| 
 | 
 | ||||||
|     def first(self): |     def first(self): | ||||||
|  |         if len(self.result) > 0: | ||||||
|             return self.result[0] |             return self.result[0] | ||||||
|  |         return self.rowFactory(None, self) | ||||||
| 
 | 
 | ||||||
|     @Lazy |     @Lazy | ||||||
|     def displayedColumns(self): |     def displayedColumns(self): | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		
		Reference in a new issue