Fix NULL dereference when CTLineCreateTruncatedLine fails and returns a NULL
Corrected coding style
Merge pull request #818 from Miners/layout-crash

Fix NULL dereference when CTLineCreateTruncatedLine fails and returns a NULL