diff --git a/examples/vweb_fullstack/src/auth_services.v b/examples/vweb_fullstack/src/auth_services.v index 798b9354774554..edd14c0412645d 100644 --- a/examples/vweb_fullstack/src/auth_services.v +++ b/examples/vweb_fullstack/src/auth_services.v @@ -37,6 +37,9 @@ fn (mut app App) service_auth(username string, password string) !string { users := sql db { select from User where username == username }! + if users.len == 0 { + return error('user not found') + } user := users.first() if user.username != username { return error('user not found')