From 0c550c343fecaec3e04fba274d1ac08bd722d311 Mon Sep 17 00:00:00 2001 From: Marc Blank Date: Thu, 12 Jan 2012 13:36:50 -0800 Subject: [PATCH] Return "0" for unknown columns in UIProvider queries * For now, let's avoid exceptions Change-Id: I5758f3aefb458c00fd3fc1865e63df92e9ba1650 --- src/com/android/email/provider/EmailProvider.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/com/android/email/provider/EmailProvider.java b/src/com/android/email/provider/EmailProvider.java index 9525e2023..6bbdf5e0a 100644 --- a/src/com/android/email/provider/EmailProvider.java +++ b/src/com/android/email/provider/EmailProvider.java @@ -2708,7 +2708,6 @@ outer: /** * Support for UnifiedEmail below */ - /** * Mapping of UIProvider columns to EmailProvider columns for the message list (called the * conversation list in UnifiedEmail) @@ -2804,7 +2803,13 @@ outer: } else { sb.append(','); } - sb.append(map.get(column)); + String val = map.get(column); + // If we don't have the column, be permissive, returning "0 AS ", and warn + if (val == null) { + Log.w(TAG, "UIProvider column not found, returning 0: " + column); + val = "0 AS " + column; + } + sb.append(val); } return sb; }