Fixed crash when renderTarget is nil