Fix handleProtoChange erroring when userSettingsProto is undefined (#1150)

This commit is contained in:
Nuckyz 2023-05-16 11:53:17 -03:00 committed by GitHub
parent 263884cbd8
commit 235000cf41
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -321,7 +321,7 @@ export default definePlugin({
},
handleProtoChange(proto: any, user: any) {
if ((!proto.appearance && !AppearanceSettingsProto) || !UserSettingsProtoStore) return;
if (proto == null || typeof proto === "string" || !UserSettingsProtoStore || (!proto.appearance && !AppearanceSettingsProto)) return;
const premiumType: number = user?.premium_type ?? UserStore?.getCurrentUser()?.premiumType ?? 0;