mirror of
				https://github.com/qgis/QGIS.git
				synced 2025-11-03 00:14:12 -05:00 
			
		
		
		
	[Processing] Fix when iface is None
This commit is contained in:
		
							parent
							
								
									46ff59bbfe
								
							
						
					
					
						commit
						e765bb6dd1
					
				@ -386,7 +386,8 @@ class GeoAlgorithm:
 | 
			
		||||
                            return
 | 
			
		||||
        try:
 | 
			
		||||
            from qgis.utils import iface
 | 
			
		||||
            self.crs = iface.mapCanvas().mapSettings().destinationCrs()
 | 
			
		||||
            if iface is not None:
 | 
			
		||||
                self.crs = iface.mapCanvas().mapSettings().destinationCrs()
 | 
			
		||||
        except:
 | 
			
		||||
            pass
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -385,9 +385,10 @@ class ModelerAlgorithm(GeoAlgorithm):
 | 
			
		||||
                if param.name in alg.params:
 | 
			
		||||
                    value = self.resolveValue(alg.params[param.name])
 | 
			
		||||
                else:
 | 
			
		||||
                    iface.messageBar().pushMessage(self.tr("Warning"),
 | 
			
		||||
                                                   self.tr("Parameter %s in algorithm %s in the model is run with default value! Edit the model to make sure that this is correct.") % (param.name, alg.name),
 | 
			
		||||
                                                   QgsMessageBar.WARNING, 4)
 | 
			
		||||
                    if iface is not None:
 | 
			
		||||
                        iface.messageBar().pushMessage(self.tr("Warning"),
 | 
			
		||||
                                                       self.tr("Parameter %s in algorithm %s in the model is run with default value! Edit the model to make sure that this is correct.") % (param.name, alg.name),
 | 
			
		||||
                                                       QgsMessageBar.WARNING, 4)
 | 
			
		||||
                    value = None
 | 
			
		||||
                if value is None and isinstance(param, ParameterExtent):
 | 
			
		||||
                    value = self.getMinCoveringExtent()
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user