This commit is contained in:
Gervasio Marchand 2023-01-12 16:18:54 -03:00
parent 95d72cf0bd
commit 742d8eed11
No known key found for this signature in database
GPG Key ID: B7736CB188DD0A38

View File

@ -59,12 +59,12 @@ public class ApiController : Controller
[Route("index-posts-count")]
public async Task<ActionResult> IndexedPostsCount(string period)
{
if (Config.Instance.GrafanaHost.IsNullOrEmpty() || Config.Instance.GrafanaKey.IsNullOrEmpty())
if (Config.Instance.GrafanaHost.IsNullOrEmpty() || Config.Instance.GrafanaKey.IsNullOrEmpty() || !Config.Instance.GrafanaDataSourceId.HasValue)
{
return NotFound();
}
if (!Regex.IsMatch(period, "^[0-9]+[mhd]$"))
if (period.IsNullOrEmpty() || !Regex.IsMatch(period, "^[0-9]+[mhd]$"))
{
return BadRequest();
}