зеркало из https://github.com/mono/hal-sharp.git
2006-07-18 Aaron Bockover <abock@gnome.org>
* src/HalDevice.cs: Return empty Device/string arrays instead of null svn path=/trunk/hal-sharp/; revision=62708
This commit is contained in:
Родитель
c005ff984d
Коммит
6623a8a493
|
@ -1,3 +1,7 @@
|
||||||
|
2006-07-18 Aaron Bockover <abock@gnome.org>
|
||||||
|
|
||||||
|
* src/HalDevice.cs: Return empty Device/string arrays instead of null
|
||||||
|
|
||||||
2006-07-18 Aaron Bockover <abock@gnome.org>
|
2006-07-18 Aaron Bockover <abock@gnome.org>
|
||||||
|
|
||||||
* src/HalDevice.cs: Added null checks for Hal.Context to prevent
|
* src/HalDevice.cs: Added null checks for Hal.Context to prevent
|
||||||
|
|
|
@ -45,9 +45,9 @@ namespace Hal
|
||||||
|
|
||||||
public Device(Context ctx, string udi)
|
public Device(Context ctx, string udi)
|
||||||
{
|
{
|
||||||
if(ctx == null) {
|
if(ctx == null) {
|
||||||
throw new ApplicationException("Cannot create HAL device; context is null");
|
throw new ApplicationException("Cannot create HAL device; context is null");
|
||||||
}
|
}
|
||||||
|
|
||||||
this.ctx = ctx;
|
this.ctx = ctx;
|
||||||
this.udi = udi;
|
this.udi = udi;
|
||||||
|
@ -271,9 +271,9 @@ namespace Hal
|
||||||
string [] deviceUdis;
|
string [] deviceUdis;
|
||||||
int device_count;
|
int device_count;
|
||||||
|
|
||||||
if(ctx == null) {
|
if(ctx == null) {
|
||||||
return null;
|
return new string[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
switch(findMethod) {
|
switch(findMethod) {
|
||||||
case FindBy.StringMatch:
|
case FindBy.StringMatch:
|
||||||
|
@ -299,10 +299,10 @@ namespace Hal
|
||||||
|
|
||||||
public static Device [] UdisToDevices(Context ctx, string [] udis)
|
public static Device [] UdisToDevices(Context ctx, string [] udis)
|
||||||
{
|
{
|
||||||
if(ctx == null) {
|
if(ctx == null) {
|
||||||
return null;
|
return new Device[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
Device [] devices = new Device[udis.Length];
|
Device [] devices = new Device[udis.Length];
|
||||||
|
|
||||||
for(int i = 0; i < udis.Length; i++) {
|
for(int i = 0; i < udis.Length; i++) {
|
||||||
|
|
Загрузка…
Ссылка в новой задаче