Skip to content
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: Crash when using ParseQuery include with anonymous access #389

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Parse/Platform/Objects/ParseObjectClassController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
else
throw new ArgumentException($"Tried to register both {previousInfo.TypeInfo.FullName} and {typeInfo.FullName} as the ParseObject subclass of {className}. Cannot determine the right class to use because neither inherits from the other.");

#warning Constructor detection may erroneously find a constructor which should not be used.

Check warning on line 74 in Parse/Platform/Objects/ParseObjectClassController.cs

View workflow job for this annotation

GitHub Actions / check-ci

#warning: 'Constructor detection may erroneously find a constructor which should not be used.'

ConstructorInfo constructor = type.FindConstructor() ?? type.FindConstructor(typeof(string), typeof(IServiceHub));

Expand Down Expand Up @@ -112,6 +112,7 @@
Classes.TryGetValue(className, out ParseObjectClass info);
Mutex.ExitReadLock();

serviceHub = serviceHub ?? ParseClient.Instance;
Copy link
Member

@mtrezza mtrezza Jun 11, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks suspicious. Why don't we just always use ParseClient.Instance if we know it cannot be null? What is the diff between serviceHub and ParseClient.Instance?

return info is { } ? info.Instantiate().Bind(serviceHub) : new ParseObject(className, serviceHub);
}

Expand Down
Loading