Skip to content

Commit

Permalink
Merge pull request #506 from ionite34/merge-dev-to-main-5c0c582
Browse files Browse the repository at this point in the history
Merge dev to main
  • Loading branch information
ionite34 authored Feb 7, 2024
2 parents ea27537 + ab4fc76 commit 9bd67b1
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ and this project adheres to [Semantic Versioning 2.0](https://semver.org/spec/v2
- Improved error messages with process output for 7z extraction errors
- Fixed missing tkinter dependency for OneTrainer on Windows
- Fixed auto-update on macOS not starting new version from an issue in starting .app bundles with arguments
- Fixed [#436](https://github.com/LykosAI/StabilityMatrix/issues/436) - Crash on invalid json files during checkpoint indexing

## v2.8.0
### Added
Expand Down
17 changes: 14 additions & 3 deletions StabilityMatrix.Core/Services/SettingsManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -425,11 +425,22 @@ public void IndexCheckpoints()
foreach (var jsonFile in connectedModelJsons)
{
var json = File.ReadAllText(jsonFile);
var connectedModel = JsonSerializer.Deserialize<ConnectedModelInfo>(json);

if (connectedModel?.Hashes.BLAKE3 != null)
if (string.IsNullOrWhiteSpace(json))
continue;

try
{
var connectedModel = JsonSerializer.Deserialize<ConnectedModelInfo>(json);

if (connectedModel?.Hashes.BLAKE3 != null)
{
modelHashes.Add(connectedModel.Hashes.BLAKE3);
}
}
catch (Exception e)
{
modelHashes.Add(connectedModel.Hashes.BLAKE3);
Logger.Warn(e, "Failed to parse connected model info from {JsonFile}", jsonFile);
}
}

Expand Down

0 comments on commit 9bd67b1

Please sign in to comment.