Revision: 22642
http://sourceforge.net/p/bibdesk/svn/22642
Author: hofman
Date: 2018-09-21 09:27:49 +0000 (Fri, 21 Sep 2018)
Log Message:
-----------
check whether container key is writable in add/remove script commands
Modified Paths:
--------------
trunk/bibdesk/BDSKAddCommand.m
trunk/bibdesk/BDSKRemoveCommand.m
Modified: trunk/bibdesk/BDSKAddCommand.m
===================================================================
--- trunk/bibdesk/BDSKAddCommand.m 2018-09-21 06:30:27 UTC (rev 22641)
+++ trunk/bibdesk/BDSKAddCommand.m 2018-09-21 09:27:49 UTC (rev 22642)
@@ -115,7 +115,8 @@
if (containerClassDescription == nil && insertionContainer)
containerClassDescription = [insertionContainer
scriptClassDescription];
if (insertionContainer == nil || insertionKey == nil ||
- [[containerClassDescription toManyRelationshipKeys]
containsObject:insertionKey] == NO) {
+ [[containerClassDescription toManyRelationshipKeys]
containsObject:insertionKey] == NO ||
+ [containerClassDescription
hasWritablePropertyForKey:insertionKey] == NO) {
[self setScriptErrorNumber:NSArgumentsWrongScriptError];
[self setScriptErrorString:NSLocalizedString(@"Could not find
container to add to", @"Error description")];
insertionObjects = nil;
Modified: trunk/bibdesk/BDSKRemoveCommand.m
===================================================================
--- trunk/bibdesk/BDSKRemoveCommand.m 2018-09-21 06:30:27 UTC (rev 22641)
+++ trunk/bibdesk/BDSKRemoveCommand.m 2018-09-21 09:27:49 UTC (rev 22642)
@@ -111,7 +111,8 @@
if (containerClassDescription == nil && removeContainer)
containerClassDescription = [removeContainer
scriptClassDescription];
if (removeContainer == nil || removeKey == nil ||
- [[containerClassDescription toManyRelationshipKeys]
containsObject:removeKey] == NO) {
+ [[containerClassDescription toManyRelationshipKeys]
containsObject:removeKey] == NO ||
+ [containerClassDescription
hasWritablePropertyForKey:removeKey] == NO) {
[self setScriptErrorNumber:NSArgumentsWrongScriptError];
[self setScriptErrorString:NSLocalizedString(@"Could not find
container to remove from", @"Error description")];
} else {
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
_______________________________________________
Bibdesk-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bibdesk-commit