File tree Expand file tree Collapse file tree 2 files changed +8
-5
lines changed Expand file tree Collapse file tree 2 files changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -9,15 +9,15 @@ Wrapper library over [networkmanager](https://networkmanager.dev/) to better int
9
9
::: code-group
10
10
11
11
``` sh [<i class="devicon-archlinux-plain"></i> Arch]
12
- sudo pacman -Syu meson vala networkmanager gobject-introspection
12
+ sudo pacman -Syu meson vala libnm gobject-introspection
13
13
```
14
14
15
15
``` sh [<i class="devicon-fedora-plain"></i> Fedora]
16
- sudo dnf install meson gcc valac NetworkManager gobject-introspection-devel
16
+ sudo dnf install meson gcc valac NetworkManager-libnm-devel gobject-introspection-devel
17
17
```
18
18
19
19
``` sh [<i class="devicon-ubuntu-plain"></i> Ubuntu]
20
- sudo apt install meson valac network-manager -dev gobject-introspection
20
+ sudo apt install meson valac libnm -dev gobject-introspection
21
21
```
22
22
23
23
:::
Original file line number Diff line number Diff line change @@ -49,7 +49,7 @@ public class AstalNetwork.Network : Object {
49
49
}
50
50
}
51
51
52
- private NM .Device get_device (NM .DeviceType t ) {
52
+ private NM .Device ? get_device (NM .DeviceType t ) {
53
53
var valid = new GenericArray<NM . Device >();
54
54
foreach (var device in client. get_devices()) {
55
55
if (device. device_type == t)
@@ -61,7 +61,10 @@ public class AstalNetwork.Network : Object {
61
61
return device;
62
62
}
63
63
64
- return valid. get (0 );
64
+ if (valid. length > 0 )
65
+ return valid. get (0 );
66
+
67
+ return null ;
65
68
}
66
69
67
70
private void sync () {
You can’t perform that action at this time.
0 commit comments