myexperiment-hackers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[myexperiment-hackers] [2693] trunk/lib/rest.rb: fixed cases where pack


From: noreply
Subject: [myexperiment-hackers] [2693] trunk/lib/rest.rb: fixed cases where pack contributable entries were deleted
Date: Thu, 8 Sep 2011 07:33:18 -0400 (EDT)

Revision
2693
Author
dgc
Date
2011-09-08 07:33:16 -0400 (Thu, 08 Sep 2011)

Log Message

fixed cases where pack contributable entries were deleted

Modified Paths

Diff

Modified: trunk/lib/rest.rb (2692 => 2693)


--- trunk/lib/rest.rb	2011-09-07 13:13:24 UTC (rev 2692)
+++ trunk/lib/rest.rb	2011-09-08 11:33:16 UTC (rev 2693)
@@ -176,7 +176,12 @@
 
           item_attrs = { }
 
+          next if item.nil?
+
           item_uri = rest_resource_uri(item)
+          
+          next if item_uri.nil?
+
           item_attrs['resource'] = item_uri if item_uri
           item_attrs['uri'] = rest_access_uri(item)
 
@@ -570,7 +575,7 @@
     when 'Experiment';             return experiment_url(ob)
     when 'TavernaEnactor';         return runner_url(ob)
     when 'Job';                    return experiment_job_url(ob.experiment, ob)
-    when 'PackContributableEntry'; return rest_resource_uri(ob.contributable)
+    when 'PackContributableEntry'; return ob.contributable ? rest_resource_uri(ob.contributable) : nil
     when 'PackRemoteEntry';        return ob.uri
     when 'ContentType';            return content_type_url(ob)
     when 'License';                return license_url(ob)

reply via email to

[Prev in Thread] Current Thread [Next in Thread]