cens/ohmagePhone — Issue #278: Conditioning on a photo prompt crashes the phone
Author: falquaddoomi
Created: 2012-02-14 20:13:00+00:00
State: open

If you attempt to specify a condition for a prompt that involves a photo prompt (even if it's to compare it against SKIPPED), the phone will crash with the following exception in the log:

```
02-14 12:10:35.261: E/AndroidRuntime(3005): FATAL EXCEPTION: main
02-14 12:10:35.261: E/AndroidRuntime(3005): java.lang.IllegalArgumentException: No comparator defined for this prompt type.
02-14 12:10:35.261: E/AndroidRuntime(3005):	at org.ohmage.conditionevaluator.comparator.DataPointComparatorFactory.createDataPointComparator(DataPointComparatorFactory.java:59)
02-14 12:10:35.261: E/AndroidRuntime(3005):	at org.ohmage.conditionevaluator.ConditionDepthFirst.visit(ConditionDepthFirst.java:273)
02-14 12:10:35.261: E/AndroidRuntime(3005):	at org.andwellness.config.grammar.syntaxtree.expr.accept(expr.java:28)
02-14 12:10:35.261: E/AndroidRuntime(3005):	at org.ohmage.conditionevaluator.ConditionDepthFirst.visit(ConditionDepthFirst.java:121)
02-14 12:10:35.261: E/AndroidRuntime(3005):	at org.andwellness.config.grammar.syntaxtree.sentence.accept(sentence.java:23)
02-14 12:10:35.261: E/AndroidRuntime(3005):	at org.ohmage.conditionevaluator.ConditionDepthFirst.visit(ConditionDepthFirst.java:131)
02-14 12:10:35.261: E/AndroidRuntime(3005):	at org.andwellness.config.grammar.syntaxtree.sentence.accept(sentence.java:23)
02-14 12:10:35.261: E/AndroidRuntime(3005):	at org.ohmage.conditionevaluator.ConditionDepthFirst.visit(ConditionDepthFirst.java:89)
02-14 12:10:35.261: E/AndroidRuntime(3005):	at org.ohmage.conditionevaluator.DataPointConditionEvaluator.evaluateCondition(DataPointConditionEvaluator.java:74)
02-14 12:10:35.261: E/AndroidRuntime(3005):	at org.ohmage.activity.SurveyActivity$1.onClick(SurveyActivity.java:413)
02-14 12:10:35.261: E/AndroidRuntime(3005):	at android.view.View.performClick(View.java:2532)
02-14 12:10:35.261: E/AndroidRuntime(3005):	at android.view.View$PerformClick.run(View.java:9291)
02-14 12:10:35.261: E/AndroidRuntime(3005):	at android.os.Handler.handleCallback(Handler.java:587)
02-14 12:10:35.261: E/AndroidRuntime(3005):	at android.os.Handler.dispatchMessage(Handler.java:92)
02-14 12:10:35.261: E/AndroidRuntime(3005):	at android.os.Looper.loop(Looper.java:150)
02-14 12:10:35.261: E/AndroidRuntime(3005):	at android.app.ActivityThread.main(ActivityThread.java:4379)
02-14 12:10:35.261: E/AndroidRuntime(3005):	at java.lang.reflect.Method.invokeNative(Native Method)
02-14 12:10:35.261: E/AndroidRuntime(3005):	at java.lang.reflect.Method.invoke(Method.java:507)
02-14 12:10:35.261: E/AndroidRuntime(3005):	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:846)
02-14 12:10:35.261: E/AndroidRuntime(3005):	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:604)
02-14 12:10:35.261: E/AndroidRuntime(3005):	at dalvik.system.NativeStart.main(Native Method)
```