MB-10474: Avoid assigning a NULL pointer to string

- Assigning a char pointer to a string would cause a
segmentation fault if the char pointer were NULL.

- Fix: Placing a check before this assignment.

Change-Id: Ia43649bab628fc548e86ef9f3c663519032eded0
Reviewed-on: http://review.couchbase.org/34656
Reviewed-by: Sundararaman Sridharan <sundar@couchbase.com>
Tested-by: abhinav dangeti <abhinav@couchbase.com>