Merge "slim_ngd: Add NULL pointer check apart from error check"