Skip to content

Commit

Permalink
Fix null errors
Browse files Browse the repository at this point in the history
Several errors are shown when the extension is disabled and
re-enabled during desktop lock.

Fix #1351
  • Loading branch information
sergio-costas committed Aug 26, 2024
1 parent 37dd477 commit b03fa95
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
4 changes: 2 additions & 2 deletions appIconIndicators.js
Original file line number Diff line number Diff line change
Expand Up @@ -785,8 +785,8 @@ export class UnityIndicator extends IndicatorBase {
const defaultFontSize = fontDesc.get_size() / 1024;
let fontSize = defaultFontSize * 0.9;
const {iconSize} = Main.overview.dash;
const defaultIconSize = Docking.DockManager.settings.get_default_value(
'dash-max-icon-size').unpack();
const defaultIconSize = Docking.DockManager.settings?.get_default_value(
'dash-max-icon-size').unpack() ?? 64;

if (!fontDesc.get_size_is_absolute()) {
// fontSize was expressed in points, so convert to pixel
Expand Down
3 changes: 2 additions & 1 deletion docking.js
Original file line number Diff line number Diff line change
Expand Up @@ -1749,7 +1749,7 @@ export class DockManager {
}

static get settings() {
return DockManager.getDefault().settings;
return DockManager.getDefault()?.settings;
}

get extension() {
Expand Down Expand Up @@ -2545,6 +2545,7 @@ export class DockManager {
}

destroy() {
this._signalsHandler.destroy();
this.emit('destroy');
if (this._toggleLater) {
Utils.laterRemove(this._toggleLater);
Expand Down
3 changes: 3 additions & 0 deletions locations.js
Original file line number Diff line number Diff line change
Expand Up @@ -1484,6 +1484,9 @@ Signals.addSignalMethods(Removables.prototype);
*/
function getApps() {
const dockManager = Docking.DockManager.getDefault();
if (dockManager == null) {
return [];
}
const locationApps = [];

if (dockManager.removables)
Expand Down

0 comments on commit b03fa95

Please sign in to comment.