Fixed a bug that panic occurs when the value is null
This commit is contained in:
		
							parent
							
								
									61a878dc2d
								
							
						
					
					
						commit
						360328b8c6
					
				@ -106,7 +106,12 @@ func (h Hstore) Value() (driver.Value, error) {
 | 
				
			|||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	for key, value := range h {
 | 
						for key, value := range h {
 | 
				
			||||||
		hstore.Map[key] = sql.NullString{String: *value, Valid: true}
 | 
							var s sql.NullString
 | 
				
			||||||
 | 
							if value != nil {
 | 
				
			||||||
 | 
								s.String = *value
 | 
				
			||||||
 | 
								s.Valid = true
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
							hstore.Map[key] = s
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	return hstore.Value()
 | 
						return hstore.Value()
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user