Skip to content

Commit

Permalink
Remove compilation warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
tatarincev committed Dec 3, 2018
1 parent 76502e7 commit 3f324d3
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions VirtoCommerce.LiquidThemeEngine/ShopifyLiquidThemeEngine.cs
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ public IEnumerable<string> DiscoveryPaths
{
get
{
IEnumerable<string> retVal = Enumerable.Empty<string>();
var retVal = Enumerable.Empty<string>();
if (WorkContext.CurrentStore != null)
{
retVal = _options.TemplatesDiscoveryFolders.Select(x => Path.Combine(CurrentThemePath, x));
Expand Down Expand Up @@ -187,7 +187,7 @@ public Stream GetAssetStream(string filePath)
try
{
//handle scss resources
CompilationResult result = SassCompiler.Compile(content);
var result = SassCompiler.Compile(content);
content = result.CompiledContent;

retVal = new MemoryStream(Encoding.UTF8.GetBytes(content));
Expand Down Expand Up @@ -230,7 +230,9 @@ public string GetAssetHash(string filePath)
public string ResolveTemplatePath(string templateName)
{
if (WorkContext.CurrentStore == null)
{
return null;
}

var liquidTemplateFileName = string.Format(_liquidTemplateFormat, templateName);
var curentThemeDiscoveryPaths = _options.TemplatesDiscoveryFolders.Select(x => Path.Combine(CurrentThemePath, x, liquidTemplateFileName));
Expand All @@ -248,8 +250,9 @@ public string ResolveTemplatePath(string templateName)
public string RenderTemplateByName(string templateName, Dictionary<string, object> parameters)
{
if (string.IsNullOrEmpty(templateName))
{
throw new ArgumentNullException(nameof(templateName));

}
var templateContent = ReadTemplateByName(templateName);
var retVal = RenderTemplate(templateContent, parameters);
return retVal;
Expand Down Expand Up @@ -324,8 +327,7 @@ public IDictionary GetSettings(string defaultValue = null)
if (currentPreset is JValue)
{
var currentPresetName = ((JValue)currentPreset).Value.ToString();
var presets = resultSettings.GetValue("presets") as JObject;
if (presets == null || !presets.Children().Any())
if (!(resultSettings.GetValue("presets") is JObject presets) || !presets.Children().Any())
{
throw new StorefrontException("Setting presets not defined");
}
Expand Down

0 comments on commit 3f324d3

Please sign in to comment.