Commit 8d17a34
refactor: potential nullreferenceexception in basesettings constructor (#1212)
The constructor of `BaseSettings<T>` uses `Activator.CreateInstance(typeof(T))` to initialize the `Component` property. If `T` does not have a parameterless constructor or if `T` is an interface or abstract class, this will throw an exception at runtime, potentially causing a crash.
Affected files: BaseSettings.cs
Signed-off-by: BachDEV <1437214+bachdev@users.noreply.github.com>
Co-authored-by: Sam <sam@spiritreader.eu>1 parent 26cf8a3 commit 8d17a34
1 file changed
+3
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | | - | |
| 22 | + | |
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
27 | | - | |
28 | | - | |
29 | | - | |
| 27 | + | |
| 28 | + | |
30 | 29 | | |
31 | 30 | | |
0 commit comments