I like niether, personnaly.
If any of them returns a null you get a nullpointer exception on the line...
Now... which one of them did go wrong ?
Now, method chaining can be and is very usefull with some specific usage patterns. Say for example in a fluent type interface (most mocking framework will do this, at least the ones I`ve seen).
Ideally one should strive to reduce coupling and this pattern does exactly the opposite.
From experience when I find myself having to dig deep in my object structure to do a task it usually is an indicator that my object structure or my business logic is not right. Perhaps the work could be buried deeper through some kind of wrapper object / facade / delegate and just call that instead. Perhaps your function or method is doing too much and should be split in smaller, more specialized chunks. Perhaps the object needs to expose properties of the items inside instead of exposing the item as a whole. It all depends on your architecture and use cases.
That said, software needs to be shipped and that usually means some parts will be more hackish than others, Ideally these should be well isolated bounded and boxed and method chaining like this weather done through successive variable assignement or directly tends to break these boundaries reducing the overall stability.