mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-12 18:27:23 +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>
|
||||
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>
|
||||
/// Gets or sets a list of custom repos.
|
||||
/// </summary>
|
||||
|
|
@ -252,7 +247,7 @@ namespace Dalamud.Configuration.Internal
|
|||
/// <returns>The deserialized configuration file.</returns>
|
||||
public static DalamudConfiguration Load(string path)
|
||||
{
|
||||
DalamudConfiguration deserialized;
|
||||
DalamudConfiguration deserialized = null;
|
||||
try
|
||||
{
|
||||
deserialized = JsonConvert.DeserializeObject<DalamudConfiguration>(File.ReadAllText(path), SerializerSettings);
|
||||
|
|
@ -260,9 +255,9 @@ namespace Dalamud.Configuration.Internal
|
|||
catch (Exception ex)
|
||||
{
|
||||
Log.Warning(ex, "Failed to load DalamudConfiguration at {0}", path);
|
||||
deserialized = new DalamudConfiguration();
|
||||
}
|
||||
|
||||
deserialized ??= new DalamudConfiguration();
|
||||
deserialized.configPath = path;
|
||||
|
||||
return deserialized;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue