forked from Elara6331/itd
		
	Make sure fs is only updated if dev.FS() succeeds (#11)
This commit is contained in:
		@@ -112,14 +112,14 @@ func handleConnection(conn net.Conn, dev *infinitime.Device, fs *blefs.FS) {
 | 
				
			|||||||
		// Get new FS
 | 
							// Get new FS
 | 
				
			||||||
		newFS, err := dev.FS()
 | 
							newFS, err := dev.FS()
 | 
				
			||||||
		if err != nil {
 | 
							if err != nil {
 | 
				
			||||||
			fs = nil
 | 
					 | 
				
			||||||
			log.Warn().Err(err).Msg("Error updating BLE filesystem")
 | 
								log.Warn().Err(err).Msg("Error updating BLE filesystem")
 | 
				
			||||||
		}
 | 
							} else {
 | 
				
			||||||
			// Set FS pointer to new FS
 | 
								// Set FS pointer to new FS
 | 
				
			||||||
			*fs = *newFS
 | 
								*fs = *newFS
 | 
				
			||||||
			// Reset updateFS
 | 
								// Reset updateFS
 | 
				
			||||||
			updateFS = false
 | 
								updateFS = false
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	// Create new scanner on connection
 | 
						// Create new scanner on connection
 | 
				
			||||||
	scanner := bufio.NewScanner(conn)
 | 
						scanner := bufio.NewScanner(conn)
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user