That's nice advice - but in this case I think one should have a guarantee

Does it make sense to receive a null intent ? Is it even possible with the 
current android code ?

On Thursday, July 11, 2013 9:46:00 AM UTC+3, Piren wrote:
>
> No point of being sure here... even if the current code is structured in a 
> way that it shouldn't be null, nothing says it will stay like that in all 
> future code revisions.
> Ever since i started getting null exceptions from android (not 
> NullPointerException... a Null instead of an exception) i learned it's 
> always a good idea to check for nulls when you're supposed to receive an 
> object.
>
> On Thursday, July 11, 2013 6:01:13 AM UTC+3, Palmer Eldritch wrote:
>>
>> I suspect it can't be null *by construction* - I just can't pin it down 
>> in code (or in docs)
>>
>> It's nice to be sure
>>
>> Can somebody point to the relevant code parts ?
>>
>> I mean what paths lead to the onReceive being triggered ? Can we have a 
>> null intent in any of them ?
>>
>> On Thursday, July 11, 2013 4:18:09 AM UTC+3, TreKing wrote:
>>>
>>>
>>> On Wed, Jul 10, 2013 at 4:14 PM, Palmer Eldritch <the....@gmail.com>wrote:
>>>
>>>> I mean nobody knows ??
>>>>
>>>> Do you ever check the intent for being null and if not why ?
>>>>
>>>
>>> Here's what you do. Assume it will not be null, then use ACRA or some 
>>> other bug-reporting tool to handle uncaught exceptions. If you get a null 
>>> pointer exception from here, you know it can be null.
>>>
>>> You're welcome.
>>>
>>>
>>> -------------------------------------------------------------------------------------------------
>>> TreKing <http://sites.google.com/site/rezmobileapps/treking> - Chicago 
>>> transit tracking app for Android-powered devices
>>>  
>>

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to