mirror of https://github.com/minio/minio.git
				
				
				
			Treat empty xl.json as file not found (#6804)
If the buffer is empty we can avoid parsing it and treat it essentially as `xl.json` is effectively missing.
This commit is contained in:
		
							parent
							
								
									2447bb58dd
								
							
						
					
					
						commit
						c82acc599a
					
				|  | @ -311,6 +311,9 @@ func readXLMeta(ctx context.Context, disk StorageAPI, bucket string, object stri | ||||||
| 		} | 		} | ||||||
| 		return xlMetaV1{}, err | 		return xlMetaV1{}, err | ||||||
| 	} | 	} | ||||||
|  | 	if len(xlMetaBuf) == 0 { | ||||||
|  | 		return xlMetaV1{}, errFileNotFound | ||||||
|  | 	} | ||||||
| 	// obtain xlMetaV1{} using `github.com/tidwall/gjson`.
 | 	// obtain xlMetaV1{} using `github.com/tidwall/gjson`.
 | ||||||
| 	xlMeta, err = xlMetaV1UnmarshalJSON(ctx, xlMetaBuf) | 	xlMeta, err = xlMetaV1UnmarshalJSON(ctx, xlMetaBuf) | ||||||
| 	if err != nil { | 	if err != nil { | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue