!433 context 空指针引用

Merge pull request !433 from chenlang/master
This commit is contained in:
openharmony_ci 2023-06-12 02:27:25 +00:00 committed by Gitee
commit 8a70e59fee
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -38,6 +38,10 @@ export class BrightnessSettingModel extends BaseModel{
constructor() {
super();
if(!globalThis.settingsAbilityContext){
LogUtil.info("globalThis.settingsAbilityContext is null");
return;
}
data_dataShare.createDataShareHelper(globalThis.settingsAbilityContext, this.listenUri)
.then((dataHelper) => {
this.dataShareHelper = dataHelper;