mirror of
				https://github.com/liberatedsystems/Sideband_CE.git
				synced 2024-09-03 04:13:27 +02:00 
			
		
		
		
	Fixed missing check for None on telemetry save, when own location was not yet determined
This commit is contained in:
		
							parent
							
								
									237f6693f7
								
							
						
					
					
						commit
						ddbb03af51
					
				@ -1642,14 +1642,15 @@ class SidebandCore():
 | 
				
			|||||||
                if rl and "latitude" in rl and "longitude" in rl and "altitude" in rl:
 | 
					                if rl and "latitude" in rl and "longitude" in rl and "altitude" in rl:
 | 
				
			||||||
                    if self.latest_telemetry != None and "location" in self.latest_telemetry:
 | 
					                    if self.latest_telemetry != None and "location" in self.latest_telemetry:
 | 
				
			||||||
                        ol = self.latest_telemetry["location"]
 | 
					                        ol = self.latest_telemetry["location"]
 | 
				
			||||||
                        if "latitude" in ol and "longitude" in ol and "altitude" in ol:
 | 
					                        if ol != None:
 | 
				
			||||||
                            olat = ol["latitude"]; olon = ol["longitude"]; oalt = ol["altitude"]
 | 
					                            if "latitude" in ol and "longitude" in ol and "altitude" in ol:
 | 
				
			||||||
                            rlat = rl["latitude"]; rlon = rl["longitude"]; ralt = rl["altitude"]
 | 
					                                olat = ol["latitude"]; olon = ol["longitude"]; oalt = ol["altitude"]
 | 
				
			||||||
                            if olat != None and olon != None and oalt != None:
 | 
					                                rlat = rl["latitude"]; rlon = rl["longitude"]; ralt = rl["altitude"]
 | 
				
			||||||
                                if rlat != None and rlon != None and ralt != None:
 | 
					                                if olat != None and olon != None and oalt != None:
 | 
				
			||||||
                                    remote_telemeter.sensors["received"].set_distance(
 | 
					                                    if rlat != None and rlon != None and ralt != None:
 | 
				
			||||||
                                        (olat, olon, oalt), (rlat, rlon, ralt)
 | 
					                                        remote_telemeter.sensors["received"].set_distance(
 | 
				
			||||||
                                    )
 | 
					                                            (olat, olon, oalt), (rlat, rlon, ralt)
 | 
				
			||||||
 | 
					                                        )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                remote_telemeter.sensors["received"].update_data()
 | 
					                remote_telemeter.sensors["received"].update_data()
 | 
				
			||||||
                telemetry = remote_telemeter.packed()
 | 
					                telemetry = remote_telemeter.packed()
 | 
				
			||||||
@ -1677,7 +1678,10 @@ class SidebandCore():
 | 
				
			|||||||
            return telemetry
 | 
					            return telemetry
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        except Exception as e:
 | 
					        except Exception as e:
 | 
				
			||||||
            RNS.log("An error occurred while saving telemetry to database: "+str(e), RNS.LOG_ERROR)
 | 
					            import traceback
 | 
				
			||||||
 | 
					            exception_info = "".join(traceback.TracebackException.from_exception(e).format())
 | 
				
			||||||
 | 
					            RNS.log(f"A {str(type(e))} occurred while saving telemetry to database: {str(e)}", RNS.LOG_ERROR)
 | 
				
			||||||
 | 
					            RNS.log(exception_info, RNS.LOG_ERROR)
 | 
				
			||||||
            self.db = None
 | 
					            self.db = None
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def _db_update_appearance(self, context_dest, timestamp, appearance, from_bulk_telemetry=False):
 | 
					    def _db_update_appearance(self, context_dest, timestamp, appearance, from_bulk_telemetry=False):
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user