mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-22 08:29:18 +01:00
fix: safeguard against dalamudConfig.json that serializes to null
This commit is contained in:
parent
9b8c541741
commit
9c30a36cd0
1 changed files with 2 additions and 7 deletions
|
|
@ -87,11 +87,6 @@ namespace Dalamud.Configuration.Internal
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string? DalamudBetaKey { get; set; } = null;
|
public string? DalamudBetaKey { get; set; } = null;
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Gets or sets a value indicating whether or not XL should download the Dalamud .NET runtime.
|
|
||||||
/// </summary>
|
|
||||||
public bool DoDalamudRuntime { get; set; } = false;
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets a list of custom repos.
|
/// Gets or sets a list of custom repos.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
@ -252,7 +247,7 @@ namespace Dalamud.Configuration.Internal
|
||||||
/// <returns>The deserialized configuration file.</returns>
|
/// <returns>The deserialized configuration file.</returns>
|
||||||
public static DalamudConfiguration Load(string path)
|
public static DalamudConfiguration Load(string path)
|
||||||
{
|
{
|
||||||
DalamudConfiguration deserialized;
|
DalamudConfiguration deserialized = null;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
deserialized = JsonConvert.DeserializeObject<DalamudConfiguration>(File.ReadAllText(path), SerializerSettings);
|
deserialized = JsonConvert.DeserializeObject<DalamudConfiguration>(File.ReadAllText(path), SerializerSettings);
|
||||||
|
|
@ -260,9 +255,9 @@ namespace Dalamud.Configuration.Internal
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
Log.Warning(ex, "Failed to load DalamudConfiguration at {0}", path);
|
Log.Warning(ex, "Failed to load DalamudConfiguration at {0}", path);
|
||||||
deserialized = new DalamudConfiguration();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
deserialized ??= new DalamudConfiguration();
|
||||||
deserialized.configPath = path;
|
deserialized.configPath = path;
|
||||||
|
|
||||||
return deserialized;
|
return deserialized;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue