Updated to handle errors by outputting NULL

Signed-off-by: Brandyn A. White <bwhite@dappervision.com>