From 4ed2d2243deef5c29876dacb61dada1df1988d2c Mon Sep 17 00:00:00 2001 From: Ricardo Carneiro Date: Tue, 12 Aug 2025 20:06:34 -0300 Subject: [PATCH] =?UTF-8?q?fix:=20corrigir=20obter=20usu=C3=A1rio?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Services/UserService.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Services/UserService.cs b/Services/UserService.cs index adee90d..ede7312 100644 --- a/Services/UserService.cs +++ b/Services/UserService.cs @@ -24,8 +24,12 @@ namespace QRRapidoApp.Services try { if (_context.Users == null) return null; // Development mode without MongoDB - - var userData = await _context.Users.Find(u => u.Id == userId).FirstOrDefaultAsync(); + User? userData = null; + + if (!String.IsNullOrEmpty(userId)) + { + userData = await _context.Users.Find(u => u.Id == userId).FirstOrDefaultAsync(); + } return userData ?? new User(); }