From 2031b3fd3c39658491837e15dcdc3f5d25c747c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Pi=C4=8Dman?= Date: Thu, 16 Oct 2014 14:54:18 +0200 Subject: [PATCH] Locking of inexistent files fails #292 --- lib/redmine_dmsf/webdav/dmsf_resource.rb | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/redmine_dmsf/webdav/dmsf_resource.rb b/lib/redmine_dmsf/webdav/dmsf_resource.rb index 41626bc2..48f7b910 100644 --- a/lib/redmine_dmsf/webdav/dmsf_resource.rb +++ b/lib/redmine_dmsf/webdav/dmsf_resource.rb @@ -397,7 +397,7 @@ module RedmineDmsf end # Lock Check - # Check for the existance of locks + # Check for the existence of locks # At present as deletions of folders are not recursive, we do not need to extend # this to cover every file, just queried def lock_check(lock_scope=nil) @@ -410,8 +410,9 @@ module RedmineDmsf # Lock def lock(args) - return Conflict unless (parent.projectless_path == "/" || parent_exists?) - lock_check(args[:scope]) + return Conflict unless (parent.projectless_path == '/' || parent_exists?) + lock_check(args[:scope]) + raise DAV4Rack::LockFailure.new("Path does't exist: #{@path}") unless exists? entity = file? ? file : folder begin if (entity.locked? && entity.locked_for_user?)