From 7cfb03c314ddd54eec7e3b3c73dbf874b6703072 Mon Sep 17 00:00:00 2001 From: Nicolae Claudius Date: Sat, 16 Jun 2012 14:35:18 +0300 Subject: [PATCH] handle when no NS is submited, just in case --- app/models/soa.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/soa.rb b/app/models/soa.rb index e733ac7..1722233 100644 --- a/app/models/soa.rb +++ b/app/models/soa.rb @@ -21,7 +21,7 @@ class SOA < Record after_initialize :disassemble_content before_validation do - self.primary_ns ||= domain.ns_records.first.content + self.primary_ns ||= domain.ns_records.first.try(:content) end # This allows us to have these convenience attributes act like any other