Skip to content

Commit 04267c7

Browse files
Merge pull request #8 from CoderGamester/develop
Release 0.6.1
2 parents 7279e03 + 92827e0 commit 04267c7

File tree

3 files changed

+13
-4
lines changed

3 files changed

+13
-4
lines changed

CHANGELOG.md

+5
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@ All notable changes to this package will be documented in this file.
44
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
55
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
66

7+
## [0.6.1] - 2024-11-01
8+
9+
**Fix**:
10+
- Fixed an issue that would crash the execution when calling *Remove()* & *RemoveOrigin* from *ObservableResolverDictionary*
11+
712
## [0.6.0] - 2023-08-05
813

914
- Improved the *ObservableResolverList* and *ObservableResolverDictionary* data types to properly resolve lists and dictionaries with different data types from the original collection.

Runtime/ObservableDictionary.cs

+6-2
Original file line numberDiff line numberDiff line change
@@ -453,7 +453,9 @@ public override void Add(TKey key, TValue value)
453453
/// <inheritdoc />
454454
public override bool Remove(TKey key)
455455
{
456-
var pair = _toOrignResolver(key, Dictionary[key]);
456+
if(!Dictionary.TryGetValue(key, out var value)) return false;
457+
458+
var pair = _toOrignResolver(key, value);
457459

458460
_dictionary.Remove(pair.Key);
459461

@@ -479,7 +481,9 @@ public void AddOrigin(TKeyOrigin key, TValueOrigin value)
479481
/// <inheritdoc />
480482
public bool RemoveOrigin(TKeyOrigin key)
481483
{
482-
var convertPair = _fromOrignResolver(new KeyValuePair<TKeyOrigin, TValueOrigin>(key, OriginDictionary[key]));
484+
if (!_dictionary.TryGetValue(key, out var value)) return false;
485+
486+
var convertPair = _fromOrignResolver(new KeyValuePair<TKeyOrigin, TValueOrigin>(key, value));
483487

484488
_dictionary.Remove(key);
485489
return base.Remove(convertPair.Key);

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
"name": "com.gamelovers.dataextensions",
33
"displayName": "Unity Data Type Extensions",
44
"author": "Miguel Tomas",
5-
"version": "0.6.0",
6-
"unity": "2022.4",
5+
"version": "0.6.1",
6+
"unity": "2022.3",
77
"license": "MIT",
88
"description": "This package extends various sets of data types to be used in any type of data containers or persistent serializable data",
99
"type": "library",

0 commit comments

Comments
 (0)