`LogWriter::Close(LW)` is outside the null check if-else block, which, when `LW == nullptr`, will causing a NULL dereference.
I think the close() means to be in else block, which is when `LW != nullptr`.
Reviewed By: xgupta
Differential Revision: https://reviews.llvm.org/D145039