HtmlText null exception fix
HtmlText Mode switch fix
Control panel fix
(cherry picked from commit b7d2cd0600
)
This commit is contained in:
@ -1,3 +1,5 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using System.Net.Http;
|
||||
using Microsoft.AspNetCore.Components;
|
||||
@ -31,8 +33,10 @@ namespace Oqtane.Modules.HtmlText.Services
|
||||
HtmlTextInfo htmltext;
|
||||
try
|
||||
{
|
||||
// exception handling is required because GetJsonAsync() returns an error if no content exists for the ModuleId ( https://github.com/aspnet/AspNetCore/issues/14041 )
|
||||
htmltext = await _http.GetJsonAsync<HtmlTextInfo>(apiurl + "/" + ModuleId.ToString() + "?entityid=" + ModuleId.ToString());
|
||||
//because GetJsonAsync() returns an error if no content exists for the ModuleId ( https://github.com/aspnet/AspNetCore/issues/14041 )
|
||||
//null value is transfered as empty list
|
||||
var htmltextList = await _http.GetJsonAsync<List<HtmlTextInfo>>(apiurl + "/" + ModuleId.ToString() + "?entityid=" + ModuleId.ToString());
|
||||
htmltext = htmltextList.FirstOrDefault();
|
||||
}
|
||||
catch
|
||||
{
|
||||
|
Reference in New Issue
Block a user