null

IEnumerable is null when I expect values

↘锁芯ラ 提交于 2019-12-11 04:57:26
问题 I am using the approach in this article to return a list of objects that are posted to my action. My method looks like: // // POST: /LeaveRequest/Create [Authorize, HttpPost] public ActionResult Create(LeaveRequest leaveRequest, IEnumerable<DayRequested> requestedDays) { return RedirectToAction("Index", lrRepository.GetLeaveRequests(472940821)); } leaveRequest has the data that I expect. requestedDays contains the number of rows I expect, but all of the rows contain null in each field. Any

FirebaseInitProvider crash when trying to run app

本小妞迷上赌 提交于 2019-12-11 04:54:37
问题 I implemented the new FCM on the app following the steps on the FCM web. Now, I'm trying to run the app, but when I try it, the app crash with this error: 05-30 12:28:45.788 3002-3002/es.in2.otr.app.im E/AndroidRuntime: FATAL EXCEPTION: main Process: es.in2.otr.app.im, PID: 3002 java.lang.RuntimeException: Unable to get provider com.google.firebase.provider.FirebaseInitProvider: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String android.content.res.Resources

Select only columns with null/empty values from the table

孤街浪徒 提交于 2019-12-11 04:53:56
问题 I have a data set that looks like this but columns goes on as data4, data5 up to data20 id data1 data2 data3 (int) (varchar) (int) (date) ------------------------------------- 1 xyz (null) 0000-00-00 2 (empty) 321 2013-09-02 3 abc 555 2013-02-29 4 def (null) 2013-09-02 5 lmn 678 2013-03-19 I only want to select the rows that has columns with null or empty values so the customer can decide which fields are needed to be filled in their tickets. data1 data2 data3 (varchar) (int) (date) ---------

How to cast from text to int if column contain both int and NULL values in PostgreSQL

时光总嘲笑我的痴心妄想 提交于 2019-12-11 04:38:21
问题 As in title. I have one column which has some text values. For example column data1 has values ('31',32','',NULL). Now I want to update another column say data2 (type INT) with data from data1, so I am trying to do something like that: UPDATE table SET data2=CAST(data1 AS INT). The problem is because PostgreSQL cannot cast NULL or empty values to INT. 回答1: Actually, you can cast NULL to int, you just can't cast an empty string to int. Assuming you want NULL in the new column if data1 contains

Combobox with null value - SelectedItem binding

自古美人都是妖i 提交于 2019-12-11 04:18:30
问题 I would like to have a combobox with cities options to choose, one of the option is an empty option (no city). The itemsource is binded to the List of "City" objects. The List contains null value to represent an empty option. The SelectedItem is binded to a property of "City" type. Everything works except the situation when the empty option is picked in the combobox. The property binded to SelectedItem is not updated with the null value but keeps the previous selection. How could i solve this

How to fix “Field X is never assigned to and will have its default value null”?

♀尐吖头ヾ 提交于 2019-12-11 04:14:19
问题 I am trying to enter input from the console(street, city, country) but the fields are underlined and display the message(field is never assigned to and will have its value null). I have also created a method SetFullAddress which doesn't work(idk if it is because of that message). Code inside Address class: public class Address { private string street; private string city; private string country; public Address() { this.Street = street; this.City = city; this.Country = country; } public string

A few IBOutlets pointing to nil

心已入冬 提交于 2019-12-11 04:02:26
问题 After a long while I've finally started working with Objective-C again, on my only complete app so far. The goal is to eventually refactor for ARC and possibly storyboards, but for the time being I'm polishing the iOS 4.x target. I am quite rusty, so bar with me if this is a stupid question. I have a button in my main view that triggers the showAction method. The method is as follows: - (void)showAbout { AboutViewController *aboutView = [[[AboutViewController alloc] init] autorelease]; if (UI

Conversion from null-integer to pointer in comma list

家住魔仙堡 提交于 2019-12-11 04:01:47
问题 I know that in our modern world NULL and 0 are not best practices in operating with pointers, and according to cppreference: Pointer conversions A null pointer constant (see NULL), can be converted to any pointer type, and the result is the null pointer value of that type. Such conversion (known as null pointer conversion) is allowed to convert to a cv-qualified type as a single conversion, that is, it's not considered a combination of numeric and qualifying conversions. But why this code is

C# - “Object reference not set to an instance of an object”

我怕爱的太早我们不能终老 提交于 2019-12-11 03:58:56
问题 I'm currently trying to check if a reference is null before it is used by 'MyMethod' with: if (School.ClassRoom.Pupil.Age != null) { MyMethod(School.ClassRoom.Pupil.Age); } However, I'm still getting the "Object reference not set to an instance of an object" on the first line because not only is the Age null, but also the Pupil and ClassRoom are sometimes null too. I'm getting the same problems using Try, Catch, Finally, since I get the same error in the Try piece of code. I don't want to

MVC 4 List Model returning null to the controller

爷,独闯天下 提交于 2019-12-11 03:44:42
问题 Here's my code: Models public class InformationsModel { public List<InformationModel> infos { get; set; } public InformationsModel() { } } public class InformationModel { public InformationModel() { } public string Name { get; set; } public string Value { get; set; } public string Group { get; set; } public string Type { get; set; } public bool Avaiable { get; set; } } View @model InterfaceWeb.Models.InformationsModel @using (Html.BeginForm("UpdateInformations", "Main", FormMethod.Post, new {