-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix null ref in persistence service #65646
Fix null ref in persistence service #65646
Conversation
using var reader = ObjectReader.TryGetReader(stream, cancellationToken: cancellationToken); | ||
if (reader != null) | ||
return read(stringTable, reader, checksum); | ||
if (stream != null) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
stream can be null when no data is stored. didn't test the 'load first then save' scenario.
src/Workspaces/Core/Portable/Storage/SQLite/v2/SQLitePersistentStorage.cs
Outdated
Show resolved
Hide resolved
@CyrusNajmabadi what was the original null ref? the stream being null? |
Yes. |
@@ -45,6 +45,7 @@ internal sealed partial class SQLitePersistentStorage : AbstractPersistentStorag | |||
|
|||
private readonly string _insert_into_string_table_values_0 = $"insert into {StringInfoTableName}({DataColumnName}) values (?)"; | |||
private readonly string _select_star_from_string_table_where_0_limit_one = $"select * from {StringInfoTableName} where ({DataColumnName} = ?) limit 1"; | |||
private readonly string _select_star_from_string_table = $"select * from {StringInfoTableName}"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not, remove as well
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will do!
hmm for some reason your original comment on it didn't show up when I first loaded the PR. shows up now though... |
No description provided.