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

"JS ERROR: TypeError: nm_dev is null" for CDC MBIM Mobile Broadband modem breaks extension #143

Open
szpak opened this issue Jan 4, 2022 · 1 comment

Comments

@szpak
Copy link

szpak commented Jan 4, 2022

After the first installation on Dell Latitude, the extension starts, but shows no interfaces, just "---' instead of speed. In the Gnome Shell logs there is:

gnome-shell[3101]: JS ERROR: TypeError: nm_dev is null
                   _retrieve_wifi_ssid@/usr/share/gnome-shell/extensions/[email protected]/net_speed.js:458:13
                   _create_menu@/usr/share/gnome-shell/extensions/[email protected]/net_speed.js:168:34
                   _update@/usr/share/gnome-shell/extensions/[email protected]/net_speed.js:272:18

I've checked it, and the problem is caused by an interface wwp0s20f0u4c2 (renamed from wwan0) for a CDC MBIM Mobile Broadband modem (registered by the cdc_mbim driver) which doesn't have an inserted mobile card (didn't check with).

For some reasons let nm_dev = this._client.get_device_by_iface(iface); returns null which causes a null dereference.

ip reports it as:

2: wwp0s20f0u4c2: <BROADCAST,MULTICAST,NOARP> mtu 1500 qdisc noop state DOWN group default qlen 1000
    link/ether XX:XX:XX:XX:XX:XX brd ff:ff:ff:ff:ff:ff

It might be a problem with the NetworkManager client or its desired behavior - you know it better. Assuming the later nm_dev != null fixes the problem. In the first case, it might be also reported to the NM client team.

Gnome 41.1, gnome-shell-extension-netspeed-3.32-0.1.20211102git8638073.fc35.noarch

@szpak
Copy link
Author

szpak commented May 17, 2022

After upgrading to gnome-shell-extension-netspeed-3.32-0.4.20220421git5a96082.fc35.noarch I had to re-apply the workaround.

@hedayaty Are you ok with the PR changing:

    _retrieve_wifi_ssid(iface) {
        let nm_dev = this._client.get_device_by_iface(iface);
        if (nm_dev.get_device_type() == NetworkManager.DeviceType.WIFI) {
            let active_ap = nm_dev.get_active_access_point();
            if (active_ap != null) {
                return ByteArray.toString(ByteArray.fromGBytes(active_ap.get_ssid()), 'UTF-8');
            }
        }
        return null;
    }

to:

    _retrieve_wifi_ssid(iface) {
        let nm_dev = this._client.get_device_by_iface(iface);
        if (nm_dev != null && nm_dev.get_device_type() == NetworkManager.DeviceType.WIFI) {
        ...

Or you would like to explain the original reason with the NM team?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant