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

Resolved console errors in dev mode #10666

Closed
wants to merge 1 commit into from
Closed

Resolved console errors in dev mode #10666

wants to merge 1 commit into from

Conversation

GarvitDadheech
Copy link

Addressing Issue:

Desktop: Starting in dev mode with dev tools docked to main window logs error #9821

Summary

This pull request addresses an issue where the application would throw a TypeError when started in development mode with dev tools docked to the main window.

Problem

When starting the application in dev mode with dev tools docked to the main window, the following error was logged:

Steps to Reproduce

  1. Start the application in development mode.
  2. Open dev tools and dock them to the main window.
  3. Observe the console for the TypeError.

Root Cause

The issue was caused by this.rootLayoutSize() returning null, leading to an attempt to set properties on a null value.

Solution

The solution involves adding a null check before setting the width and height properties. Specifically:

  • Modified updateRootLayoutSize to check if this.rootLayoutSize() returns null.
  • If it returns null, log an error message instead of setting properties.

Code Changes

public updateRootLayoutSize() {
    this.updateMainLayout(produce(this.props.mainLayout, (draft: any) => {
        const s = this.rootLayoutSize();
        if (s) {
            draft.width = s.width;
            draft.height = s.height;
        } else {
            console.error('rootLayoutSize() returned null');
        }
    }));
}



Copy link
Contributor

CLA Assistant Lite bot:
Thank you for your submission, we really appreciate it. Like many open-source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution. You can sign the CLA by just posting a Pull Request Comment same as the below format.


I have read the CLA Document and I hereby sign the CLA


You can retrigger this bot by commenting recheck in this Pull Request

@laurent22 laurent22 closed this Jun 29, 2024
@laurent22
Copy link
Owner

It looks like the issue was created by chatgpt and the fix is not good anyway.

Repository owner locked as spam and limited conversation to collaborators Jun 29, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants