Make sure URL is not nil before inserting in array.

Fixes #1879 
The post's permalink was resulting in a nil URL, crashing when added to the array. The reason why the URL was nil remains to be determined, but checking that we have a good URL before adding prevents the crash.