Markup under feature flag

Gotcha. I think we wanna handle that by explicitly checking for that null
v., catching an arbitrary null that may be in that scope. I updated how I
was handling this for the inline tiles PR in a similar way:
https://github.com/dimagi/commcare-odk/pull/81/files#diff-cfd2cee96fbdd7dd9584267cb7dc83e3R57

-Clayton

On Thu, Dec 18, 2014 at 4:34 PM, wpride <notifications@github.com> wrote:
>
> In app/src/org/commcare/dalvik/preferences/DeveloperPreferences.java
> <https://github.com/dimagi/commcare-odk/pull/90#discussion-diff-22073173>:
>
> > @@ -69,4 +69,13 @@ public static boolean isSuperuserEnabled(){
> >          SharedPreferences properties = CommCareApplication._().getCurrentApp().getAppPreferences();
> >          return properties.getString(SUPERUSER_ENABLED, BuildConfig.DEBUG ? CommCarePreferences.YES : CommCarePreferences.NO).equals(CommCarePreferences.YES);
> >      }
> > +
> > +    public static boolean isMarkupEnabled(){
> > +        try{
> > +            SharedPreferences properties = CommCareApplication._().getCurrentApp().getAppPreferences();
> > +            return properties.getString(MARKUP_ENABLED, BuildConfig.DEBUG ? CommCarePreferences.YES : CommCarePreferences.NO).equals(CommCarePreferences.YES);
> > +        } catch(NullPointerException e){
>
> We check for this sometimes before the app is initialized. Maybe we just
> shouldn't?
> … <#14a5f531a79f8c24_>
> On Mon, Dec 15, 2014 at 2:03 PM, ctsims <notifications@github.com> wrote:
> In app/src/org/commcare/dalvik/preferences/DeveloperPreferences.java <
> https://github.com/dimagi/commcare-odk/pull/90#discussion-diff-21847669>:
> > @@ -69,4 +69,13 @@ public static boolean isSuperuserEnabled(){ >
> SharedPreferences properties =
> CommCareApplication._().getCurrentApp().getAppPreferences(); > return
> properties.getString(SUPERUSER_ENABLED, BuildConfig.DEBUG ?
> CommCarePreferences.YES :
> CommCarePreferences.NO).equals(CommCarePreferences.YES); > } > + > + public
> static boolean isMarkupEnabled(){ > + try{ > + SharedPreferences properties
> = CommCareApplication._().getCurrentApp().getAppPreferences(); > + return
> properties.getString(MARKUP_ENABLED, BuildConfig.DEBUG ?
> CommCarePreferences.YES :
> CommCarePreferences.NO).equals(CommCarePreferences.YES); > + }
> catch(NullPointerException e){ Why are you NPE checking here? what would
> cause an unexpected pointer to be null? — Reply to this email directly or
> view it on GitHub <
> https://github.com/dimagi/commcare-odk/pull/90/files#r21847669>.
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/dimagi/commcare-odk/pull/90/files#r22073173>.
>