Android System.NullReferenceException:在需要对象实例的位置找到空值
我的应用程序崩溃并给出此日志 原因:md52ce486a14f4bcd95899665e9d932190b.JavaProxyThrowable: System.NullReferenceException:在对象Android System.NullReferenceException:在需要对象实例的位置找到空值,android,xamarin,Android,Xamarin,我的应用程序崩溃并给出此日志 原因:md52ce486a14f4bcd95899665e9d932190b.JavaProxyThrowable: System.NullReferenceException:在对象 SQLClient.GetAllProfile() Comman.get_配置文件() 我的代码是 通信 public static Profile Profile { get { if (_profile == null) {
SQLClient.GetAllProfile()
Comman.get_配置文件() 我的代码是 通信
public static Profile Profile {
get {
if (_profile == null) {
var profiles = SQLClient.Instance.GetAllProfile ();
if (profiles!=null && profiles.Count > 0) {
_profile = profiles [0];
}
}
return _profile;
}
set {
_profile = value;
}
}
在SQLClient.cs中
public List<Profile> GetAllProfile()
{
lock (SQLClient.SyncObject)
{
List<Profile> list = conn.Table<Profile>().ToList();
return list;
}
}
public List GetAllProfile()
{
锁(SQLClient.SyncObject)
{
List List=conn.Table().ToList();
退货清单;
}
}
SQLClient.SyncObject或conn.GetTable方法返回空值。
您是否与调试器进行了检查?您需要提供更多信息-例如,它发生在哪一行?