Bug 26746 - Dialog.LoadMoreElement Throws "Nullable Object Must Have a Value" Exception
Summary: Dialog.LoadMoreElement Throws "Nullable Object Must Have a Value" Exception
Status: RESOLVED FIXED
Alias: None
Product: iOS
Classification: Xamarin
Component: Xamarin.iOS.dll ()
Version: XI 8.6.0
Hardware: PC Mac OS
: Normal normal
Target Milestone: Untriaged
Assignee: Alex Soto [MSFT]
URL:
Depends on:
Blocks:
 
Reported: 2015-02-04 13:40 UTC by Jimmy [MSFT]
Modified: 2015-03-06 16:33 UTC (History)
3 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:


Attachments
Repro project (19.52 KB, application/zip)
2015-02-04 13:40 UTC, Jimmy [MSFT]
Details


Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED FIXED

Description Jimmy [MSFT] 2015-02-04 13:40:07 UTC
Created attachment 9647 [details]
Repro project

=== Overview ===
LoadMoreElement.GetHeight() throws a "Nullable Object Must Have a Value" exception when trying to add it to a Section. See attached repro project. 

=== Workaround ===
Manually setting the height of the LoadMoreElement object resolves the issue. In the attached project, uncommenting line 43:

> lmeImage.Height = 10;

in "DialogErrorTestViewController.cs" allows the app to load properly. 

=== Additional Information ===
Looking at the source, it seems like the Height of a LoadMoreElement object is never initialized to null so the GetHeight method cannot return a value using the null-coalescing operator.


=== System Info ===

=== Xamarin Studio ===

Version 5.7.1 (build 14)
Installation UUID: 94ce5106-6a72-4691-b34e-cd5857b1db66
Runtime:
	Mono 3.12.0 ((detached/a813491)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 312000068

=== Xamarin.Android ===

Version: 4.20.0.28 (Business Edition)
Android SDK: /Users/jimmygarrido/Library/Developer/Xamarin/android-sdk-macosx
	Supported Android versions:
		2.1   (API level 7)
		2.2   (API level 8)
		2.3   (API level 10)
		3.1   (API level 12)
		4.0   (API level 14)
		4.0.3 (API level 15)
		4.4   (API level 19)
		5.0   (API level 21)
Java SDK: /usr
java version "1.7.0_71"
Java(TM) SE Runtime Environment (build 1.7.0_71-b14)
Java HotSpot(TM) 64-Bit Server VM (build 24.71-b01, mixed mode)

=== Apple Developer Tools ===

Xcode 6.1.1 (6611)
Build 6A2008a

=== Xamarin.iOS ===

Version: 8.6.0.51 (Business Edition)
Hash: dfb682f
Branch: 
Build date: 2015-01-08 13:39:32-0500

=== Xamarin.Mac ===

Version: 1.12.0.4 (Business Edition)

=== Build Information ===

Release ID: 507010014
Git revision: a4dd61ad7f8b3695be4b17bcb5c3ae6b81438cf7
Build date: 2015-01-19 15:21:09-05
Xamarin addins: 081208fe3bbf40e24a562867c6c7fba20a9b94b6

=== Operating System ===

Mac OS X 10.10.2
Darwin Jimmys-MacBook-Pro.local 14.1.0 Darwin Kernel Version 14.1.0
    Mon Dec 22 23:10:38 PST 2014
    root:xnu-2782.10.72~2/RELEASE_X86_64 x86_64
Comment 1 Rajneesh Kumar 2015-02-05 04:23:51 UTC
I have checked this issue and able to reproduce this. To reproduce this issue I have followed the help and instruction provide din bug description.

Steps I followed:
1. Open attached test application In XS.
2. Build and deploy it on simulator.
3. Observed that you will get get the following exception:
"Unhandled managed exception: Nullable object must have a value"

I  also observed that , after in the attached project, uncommenting line 43:[lmeImage.Height = 10;] in "DialogErrorTestViewController.cs" allows the app to load properly. 

Screencast: http://www.screencast.com/t/9ibqhSCY

Ide Logs:https://gist.github.com/Rajneesh360Logica/7429cff61827c1c1832a
Application Output: https://gist.github.com/Rajneesh360Logica/7db39a181f480384f342
Build Output: https://gist.github.com/Rajneesh360Logica/3164089677c7cad2adc3
iOS designer Logs: https://gist.github.com/Rajneesh360Logica/1b596b1962edc726a40d
Emulator Logs: https://gist.github.com/Rajneesh360Logica/726e82ddab41eb0a5857

Environment Info:

=== Xamarin Studio ===

Version 5.7.1 (build 17)
Installation UUID: 011d70a5-dede-428b-ab04-ef451c2e539d
Runtime:
	Mono 3.12.0 ((detached/a813491)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 312000068

=== Xamarin.Android ===

Version: 4.20.0.28 (Business Edition)
Android SDK: /Users/MM/Desktop/android-sdk-macosx
	Supported Android versions:
		2.1    (API level 7)
		2.2    (API level 8)
		2.3    (API level 10)
		3.1    (API level 12)
		4.0    (API level 14)
		4.0.3  (API level 15)
		4.1    (API level 16)
		4.2    (API level 17)
		4.3    (API level 18)
		4.4    (API level 19)
		4.4.87 (API level 20)
		5.0    (API level 21)
Java SDK: /usr
java version "1.7.0_65"
Java(TM) SE Runtime Environment (build 1.7.0_65-b17)
Java HotSpot(TM) 64-Bit Server VM (build 24.65-b04, mixed mode)

=== Apple Developer Tools ===

Xcode 6.1 (6604)
Build 6A1052d

=== Xamarin.iOS ===

Version: 8.6.1.20 (Business Edition)
Hash: 3b3ef43
Branch: 
Build date: 2015-01-24 09:42:21-0500

=== Xamarin.Mac ===

Version: 1.12.0.4 (Business Edition)

=== Build Information ===

Release ID: 507010017
Git revision: 0bc7d3550b6b088ac25b08dcf7bbe73bcc8658b3
Build date: 2015-02-03 19:43:29-05
Xamarin addins: f7b7d34419c9ec24501bfa7c658e80a6305613e0

=== Operating System ===

Mac OS X 10.9.5
Darwin MacMini.local 13.4.0 Darwin Kernel Version 13.4.0
    Sun Aug 17 19:50:11 PDT 2014
    root:xnu-2422.115.4~1/RELEASE_X86_64 x86_64
Comment 2 Sebastien Pouliot 2015-03-05 13:29:58 UTC
@Alex can you have a look at this ? thanks!
Comment 3 Alex Soto [MSFT] 2015-03-06 16:33:04 UTC
Hello I tried to reproduce this with latest stable X.I 8.6.2 ( and also master) and I am unable to get the exception.

Xamarin.iOS
Version: 8.6.2.26 (Business Edition)
Hash: 9905782
Branch: 
Build date: 2015-02-26 11:05:07-0500

@Jimmy Please update to Xamarin.iOS 8.6.2 and if you still see the issue please reopen the bug.