1
0
mirror of https://github.com/bitwarden/server synced 2026-01-06 10:34:01 +00:00

cleanup html node refs

This commit is contained in:
Kyle Spearrin
2018-06-19 10:18:11 -04:00
parent 18b7bcb9e3
commit 145e4c69d4
2 changed files with 31 additions and 15 deletions

View File

@@ -5,13 +5,12 @@ namespace Bit.Icons.Models
{
public class IconResult
{
public IconResult(string href, HtmlNode node)
public IconResult(string href, string sizes)
{
Path = href;
var sizesAttr = node.Attributes["sizes"];
if(!string.IsNullOrWhiteSpace(sizesAttr?.Value))
if(!string.IsNullOrWhiteSpace(sizes))
{
var sizeParts = sizesAttr.Value.Split('x');
var sizeParts = sizes.Split('x');
if(sizeParts.Length == 2 && int.TryParse(sizeParts[0].Trim(), out var width) &&
int.TryParse(sizeParts[1].Trim(), out var height))
{