java - NullPointerException for Google App Engine Text -


i have following profile bean text property:

import com.google.appengine.api.datastore.text;  public class profile {     ...      private text aboutmyself = null;      public string getaboutmyself() {         return aboutmyself.getvalue();     }     public void setaboutmyself(string aboutmyself) {         this.aboutmyself = new text(aboutmyself);     }     ... } 

when getting aboutmyself, have ff condition.

if (profile.getaboutmyself() != null){     ... } 

the problem still encountered npe line if (profile.getaboutmyself() != null) why? how fix it?

stacktrace:

uncaught exception servlet java.lang.nullpointerexception     @ profile.getaboutmyself(profile.java:263)     @ ...(.....java:137)     @ sun.reflect.nativemethodaccessorimpl.invoke0(native method)     @ sun.reflect.nativemethodaccessorimpl.invoke(nativemethodaccessorimpl.java:57)     @ sun.reflect.delegatingmethodaccessorimpl.invoke(delegatingmethodaccessorimpl.java:43)     @ java.lang.reflect.method.invoke(method.java:45)     @ com.opensymphony.xwork2.defaultactioninvocation.invokeaction(defaultactioninvocation.java:453)     @ com.opensymphony.xwork2.defaultactioninvocation.invokeactiononly(defaultactioninvocation.java:292)     @ com.opensymphony.xwork2.defaultactioninvocation.invoke(defaultactioninvocation.java:255)     @ org.apache.struts2.interceptor.debugging.debugginginterceptor.intercept(debugginginterceptor.java:256)     @ com.opensymphony.xwork2.defaultactioninvocation.invoke(defaultactioninvocation.java:249)     @ com.opensymphony.xwork2.interceptor.defaultworkflowinterceptor.dointercept(defaultworkflowinterceptor.java:176)     @ com.opensymphony.xwork2.interceptor.methodfilterinterceptor.intercept(methodfilterinterceptor.java:98)     @ com.opensymphony.xwork2.defaultactioninvocation.invoke(defaultactioninvocation.java:249)     @ com.opensymphony.xwork2.validator.validationinterceptor.dointercept(validationinterceptor.java:265) 


Comments

Popular posts from this blog

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -