mirror of
				https://github.com/SoftFever/OrcaSlicer.git
				synced 2025-10-31 04:31:15 -06:00 
			
		
		
		
	Fix of #6873: Bed texture located in a directory that user has no permission to (crashed)
This commit is contained in:
		
							parent
							
								
									0efa0fc512
								
							
						
					
					
						commit
						18c8204837
					
				
					 1 changed files with 4 additions and 2 deletions
				
			
		|  | @ -141,11 +141,13 @@ void Bed3D::Axes::render() const | |||
| bool Bed3D::set_shape(const Pointfs& shape, const std::string& custom_texture, const std::string& custom_model, bool force_as_custom) | ||||
| { | ||||
|     auto check_texture = [](const std::string& texture) { | ||||
|         return !texture.empty() && (boost::algorithm::iends_with(texture, ".png") || boost::algorithm::iends_with(texture, ".svg")) && boost::filesystem::exists(texture); | ||||
|         boost::system::error_code ec; // so the exists call does not throw (e.g. after a permission problem)
 | ||||
|         return !texture.empty() && (boost::algorithm::iends_with(texture, ".png") || boost::algorithm::iends_with(texture, ".svg")) && boost::filesystem::exists(texture, ec); | ||||
|     }; | ||||
| 
 | ||||
|     auto check_model = [](const std::string& model) { | ||||
|         return !model.empty() && boost::algorithm::iends_with(model, ".stl") && boost::filesystem::exists(model); | ||||
|         boost::system::error_code ec; | ||||
|         return !model.empty() && boost::algorithm::iends_with(model, ".stl") && boost::filesystem::exists(model, ec); | ||||
|     }; | ||||
| 
 | ||||
|     EType type; | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Lukas Matena
						Lukas Matena