mirror of
				https://gitlab.com/comunic/comunicapiv3
				synced 2025-11-04 09:34:04 +00:00 
			
		
		
		
	Fix logic bug
This commit is contained in:
		@@ -505,12 +505,12 @@ impl HttpRequestHandler {
 | 
			
		||||
 | 
			
		||||
    /// Get an optional virtual directory included in the request
 | 
			
		||||
    pub fn post_checked_virtual_directory_opt(&mut self, name: &str, target_id: u64, target_type: VirtualDirType) -> ResultBoxError<Option<String>> {
 | 
			
		||||
        if !self.has_post_parameter(name) {
 | 
			
		||||
        let dir = self.post_string_opt(name, 0, false)?;
 | 
			
		||||
 | 
			
		||||
        if dir.is_empty() {
 | 
			
		||||
            return Ok(None);
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        let dir = self.post_virtual_directory(name)?;
 | 
			
		||||
 | 
			
		||||
        if !virtual_directory_helper::check_availability(&dir, target_id, target_type)? {
 | 
			
		||||
            self.forbidden("Requested virtual directory is not available!".to_string())?;
 | 
			
		||||
        }
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user