Author: abock
Date: 2006-07-18 11:17:02 -0400 (Tue, 18 Jul 2006)
New Revision: 62708
Modified:
trunk/hal-sharp/ChangeLog
trunk/hal-sharp/src/HalDevice.cs
Log:
2006-07-18 Aaron Bockover <[EMAIL PROTECTED]>
* src/HalDevice.cs: Return empty Device/string arrays instead of null
Modified: trunk/hal-sharp/ChangeLog
===================================================================
--- trunk/hal-sharp/ChangeLog 2006-07-18 15:12:54 UTC (rev 62707)
+++ trunk/hal-sharp/ChangeLog 2006-07-18 15:17:02 UTC (rev 62708)
@@ -1,5 +1,9 @@
2006-07-18 Aaron Bockover <[EMAIL PROTECTED]>
+ * src/HalDevice.cs: Return empty Device/string arrays instead of null
+
+2006-07-18 Aaron Bockover <[EMAIL PROTECTED]>
+
* src/HalDevice.cs: Added null checks for Hal.Context to prevent
crashing in places
Modified: trunk/hal-sharp/src/HalDevice.cs
===================================================================
--- trunk/hal-sharp/src/HalDevice.cs 2006-07-18 15:12:54 UTC (rev 62707)
+++ trunk/hal-sharp/src/HalDevice.cs 2006-07-18 15:17:02 UTC (rev 62708)
@@ -45,9 +45,9 @@
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 @@
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 @@
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++) {
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches