Commit ec60aea7 authored by nanahira's avatar nanahira

skip image when data not exists

parent cddcce09
Pipeline #26024 failed with stages
in 2 minutes and 54 seconds
...@@ -53,14 +53,7 @@ namespace ImgGen ...@@ -53,14 +53,7 @@ namespace ImgGen
else else
{ {
Console.WriteLine($"Card {code} not found!"); Console.WriteLine($"Card {code} not found!");
Data data = new Data return null;
{
code = code,
name = "???",
text = "???"
};
return data;
}
} }
public static string FormatCardDesc(string r) public static string FormatCardDesc(string r)
...@@ -91,4 +84,3 @@ namespace ImgGen ...@@ -91,4 +84,3 @@ namespace ImgGen
} }
} }
} }
...@@ -149,6 +149,10 @@ namespace ImgGen ...@@ -149,6 +149,10 @@ namespace ImgGen
public Bitmap GetImage(int code) public Bitmap GetImage(int code)
{ {
Data data = DataManager.GetData(code); Data data = DataManager.GetData(code);
if (data == null)
{
return null;
}
return DrawCard(data); return DrawCard(data);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment