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:
Aaron Bockover 2006-07-18 15:17:02 +00:00
Родитель c005ff984d
Коммит 6623a8a493
2 изменённых файлов: 14 добавлений и 10 удалений

Просмотреть файл

@ -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>
* src/HalDevice.cs: Added null checks for Hal.Context to prevent

Просмотреть файл

@ -45,9 +45,9 @@ namespace Hal
public Device(Context ctx, string udi)
{
if(ctx == null) {
throw new ApplicationException("Cannot create HAL device; context is null");
}
if(ctx == null) {
throw new ApplicationException("Cannot create HAL device; context is null");
}
this.ctx = ctx;
this.udi = udi;
@ -271,9 +271,9 @@ namespace Hal
string [] deviceUdis;
int device_count;
if(ctx == null) {
return null;
}
if(ctx == null) {
return new string[0];
}
switch(findMethod) {
case FindBy.StringMatch:
@ -299,10 +299,10 @@ namespace Hal
public static Device [] UdisToDevices(Context ctx, string [] udis)
{
if(ctx == null) {
return null;
}
if(ctx == null) {
return new Device[0];
}
Device [] devices = new Device[udis.Length];
for(int i = 0; i < udis.Length; i++) {