[116902] branches/gsoc11-statistics/stats-server/app/views/ports/index.html .erb

cal at macports.org cal at macports.org
Sun Feb 9 13:20:36 PST 2014


Revision: 116902
          https://trac.macports.org/changeset/116902
Author:   cal at macports.org
Date:     2014-02-09 13:20:36 -0800 (Sun, 09 Feb 2014)
Log Message:
-----------
macports stats: avoid nil deref when categories are not set (which is invalid, but does happen from time to time, it seems)

https://lists.macosforge.org/pipermail/macports-dev/2014-February/025879.html

Modified Paths:
--------------
    branches/gsoc11-statistics/stats-server/app/views/ports/index.html.erb

Modified: branches/gsoc11-statistics/stats-server/app/views/ports/index.html.erb
===================================================================
--- branches/gsoc11-statistics/stats-server/app/views/ports/index.html.erb	2014-02-09 21:20:23 UTC (rev 116901)
+++ branches/gsoc11-statistics/stats-server/app/views/ports/index.html.erb	2014-02-09 21:20:36 UTC (rev 116902)
@@ -7,7 +7,14 @@
 
 	<% @ports.each do |port| %>
 		<dl>
-			<dt><strong><%= link_to port.name, category_port_path(port.category, port) %></strong> <%= port.version %></dt>
+			<dt>
+				<% unless port.categories.nil? %>
+					<strong><%= link_to port.name, category_port_path(port.category, port) %></strong>
+				<% else %>
+					<strong><%= port.name %></strong>
+				<% end %>
+				<%= port.version %>
+			</dt>
 			<dd>
 				<% unless port.description.nil? %>
 					<p><%= port.description %></p>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/macports-changes/attachments/20140209/759c3dc9/attachment.html>


More information about the macports-changes mailing list