fix crash for new app with no dest path existing
This commit is contained in:
		
							parent
							
								
									e07c1c4f3f
								
							
						
					
					
						commit
						24a5e6676f
					
				
							
								
								
									
										12
									
								
								app.go
									
									
									
									
									
								
							
							
						
						
									
										12
									
								
								app.go
									
									
									
									
									
								
							| @ -230,11 +230,13 @@ func (a *App) SanityCheck() error { | ||||
| 			onlineDestinations++ | ||||
| 			for _, src := range a.sources { | ||||
| 				dest2 := dest.Append("/" + src.Box() + "/" + src.Path()) | ||||
| 				for _, s := range b.zfs.filesystems[dest2.Path()].snapshots { | ||||
| 					if !s.Valid() { | ||||
| 						if err := s.Delete(); err != nil { | ||||
| 							log.WithFields(log.Fields{"app": a.name, "box": src.Box(), "snapshot": s.String(), "call": "Delete", "error": err}).Errorf("") | ||||
| 							return err | ||||
| 				if fs, ok := b.zfs.filesystems[dest2.Path()]; ok { | ||||
| 					for _, s := range fs.snapshots { | ||||
| 						if !s.Valid() { | ||||
| 							if err := s.Delete(); err != nil { | ||||
| 								log.WithFields(log.Fields{"app": a.name, "box": src.Box(), "snapshot": s.String(), "call": "Delete", "error": err}).Errorf("") | ||||
| 								return err | ||||
| 							} | ||||
| 						} | ||||
| 					} | ||||
| 				} | ||||
|  | ||||
| @ -1,7 +1,7 @@ | ||||
| // Code generated by version.sh (@generated) DO NOT EDIT. | ||||
| package main | ||||
| var githash = "db05789" | ||||
| var githash = "e07c1c4" | ||||
| var branch = "v2" | ||||
| var buildstamp = "2023-07-01_12:10:14" | ||||
| var commits = "64" | ||||
| var version = "db05789-b64 - 2023-07-01_12:10:14" | ||||
| var buildstamp = "2023-07-01_20:33:58" | ||||
| var commits = "65" | ||||
| var version = "e07c1c4-b65 - 2023-07-01_20:33:58" | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user