<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[Infinity Code Forum — Null reference on clicking a marker]]></title>
		<link>https://forum.infinity-code.com/viewtopic.php?id=260</link>
		<atom:link href="https://forum.infinity-code.com/extern.php?action=feed&amp;tid=260&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in Null reference on clicking a marker.]]></description>
		<lastBuildDate>Thu, 25 Aug 2016 10:42:05 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: Null reference on clicking a marker]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=1154#p1154</link>
			<description><![CDATA[<p>yup...that fixed it. Thanks!</p>]]></description>
			<author><![CDATA[null@example.com (gamar)]]></author>
			<pubDate>Thu, 25 Aug 2016 10:42:05 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=1154#p1154</guid>
		</item>
		<item>
			<title><![CDATA[Re: Null reference on clicking a marker]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=1153#p1153</link>
			<description><![CDATA[<p>You have points == null.<br />This can happen in three cases:<br />1. You create a drawing element (line, poly) with points = null;<br />2. You set points = null;<br />3. You add drawing element, remove it, and add again.<br />By default, when you remove drawing element, it dispose.<br />To prevent this, use OnlineMaps.RemoveDrawingElement (element, <strong>false</strong>).</p><p>In the next update, when you try to use points = null (in all three cases), you&#039;ll get an exception immediately.</p>]]></description>
			<author><![CDATA[null@example.com (Alex Vertax)]]></author>
			<pubDate>Wed, 24 Aug 2016 20:50:54 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=1153#p1153</guid>
		</item>
		<item>
			<title><![CDATA[Re: Null reference on clicking a marker]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=1152#p1152</link>
			<description><![CDATA[<p>Ok...this is weird...I haven&#039;t modified that method at all yet that is the error that I get.</p><p>I have taken another screenshot from another device and have a different stacktrace. I tracked it and the function exists this time(Horaay!)</p><p><span class="postimg"><img src="http://i.imgur.com/wwl27mW.png" alt="http://i.imgur.com/wwl27mW.png" /></span></p>]]></description>
			<author><![CDATA[null@example.com (gamar)]]></author>
			<pubDate>Wed, 24 Aug 2016 18:41:42 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=1152#p1152</guid>
		</item>
		<item>
			<title><![CDATA[Re: Null reference on clicking a marker]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=1151#p1151</link>
			<description><![CDATA[<p>I just saw that you have a very strange stack trace.<br />In the original code HitTest is not used in InitLineMesh.<br />You have modified this method?</p>]]></description>
			<author><![CDATA[null@example.com (Alex Vertax)]]></author>
			<pubDate>Wed, 24 Aug 2016 14:47:06 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=1151#p1151</guid>
		</item>
		<item>
			<title><![CDATA[Re: Null reference on clicking a marker]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=1150#p1150</link>
			<description><![CDATA[<p>Sure. Each pin has an index attached. When I tap I just call ShowStory(pinIndex).</p><div class="codebox"><pre><code>private void ShowStory (int index)
        {
            if (index &lt; 0)
                return;

            m_onlineMaps.markers [m_currentArtifactIndex].zIndex = m_currentArtifactIndex;
            m_onlineMaps.markers [m_currentArtifactIndex].scale = m_artifactsActions [m_currentArtifactIndex].Scale;

            ActivityAction marker = m_artifactsActions [index];
            m_storiesCarousel.CenterOnChild (index, false);

            if (ComputeDirectionsFromUser (index)) {
                Vector2 center;
                int zoom;
                OnlineMapsUtils.GetCenterPointAndZoom (new Vector2[2] {
                    marker.Position.Value,
                    m_userPosition.Value
                }, out center, out zoom);
                m_onlineMaps.SetPositionAndZoom (center.x, center.y, zoom - 1);
            } else {
                m_onlineMaps.SetPosition (marker.Position.Value.x, marker.Position.Value.y);
            }

            if (m_currentArtifactIndex &gt;= 0)
                m_onlineMaps.markers [m_currentArtifactIndex].scale = m_artifactsActions [m_currentArtifactIndex].Scale;
            m_onlineMaps.markers [index].scale = marker.Scale * m_selectedPinSize;

            if (!m_isStoryShowing) {
                m_isStoryShowing = true;
                m_storiesContainer.GetComponent&lt;Animator&gt; ().SetTrigger (&quot;Show&quot;);
                ToolsController.Instance.OnlineMapsController.SlideLeft (true);
            }

            m_onlineMaps.markers [index].zIndex = -1;

            CheckGoToArtifactAvailability (index);

            m_currentArtifactIndex = index;
            m_onlineMaps.Redraw ();
        }

        private bool ComputeDirectionsFromUser (int artifactIndex)
        {
            ActivityAction marker = m_artifactsActions [artifactIndex];
            if (m_artifacts [artifactIndex].State != ArtifactState.Locked &amp;&amp; IsUserCloseTo (marker.Position.Value, m_directionsRadius)) {
                StartCoroutine (ComputeDirectionsFromUser (marker.Position.Value));
                return true;
            } else {
                if (m_userDirectionLine != null)
                    m_onlineMaps.RemoveDrawingElement (m_userDirectionLine);//this is where I remove the line
                return false;
            }
        }</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (gamar)]]></author>
			<pubDate>Wed, 24 Aug 2016 14:07:39 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=1150#p1150</guid>
		</item>
		<item>
			<title><![CDATA[Re: Null reference on clicking a marker]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=1149#p1149</link>
			<description><![CDATA[<p>Hello.</p><p>It looks as if you are deleting points of line instead of a line.<br />Please show the code where you are removing the line.</p><p>Of course, this is also an issue and it will be checked and fixed.</p>]]></description>
			<author><![CDATA[null@example.com (Alex Vertax)]]></author>
			<pubDate>Wed, 24 Aug 2016 11:28:15 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=1149#p1149</guid>
		</item>
		<item>
			<title><![CDATA[Null reference on clicking a marker]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=1148#p1148</link>
			<description><![CDATA[<p>Unity version - 5.1.4f1<br />iOS version - 9.3.4<br />Android version - 4.3<br />(I think phone/os is irrelevant in this matter)<br />Maps version - 2.5.0.3 (is a beta version I know, but I need it for another feature that only exists in the beta)</p><p>When I tap on a marker I get this null pointer exception.</p><p>Marker 1 is &quot;selected&quot; and when I tap on marker 4 I want to selected it. I delete a line while doing this and I get this crash which messes my flow of execution. </p><p>It only reproduces once. After that the map needs to be reloaded to be reproduced.</p><p>I can provide any info that you need further on. Can you please help? Thank you!</p><p><span class="postimg"><img src="http://i.imgur.com/SI3MPjM.png" alt="http://i.imgur.com/SI3MPjM.png" /></span><br /><span class="postimg"><img src="http://i.imgur.com/LO6sXQ3.png" alt="http://i.imgur.com/LO6sXQ3.png" /></span></p>]]></description>
			<author><![CDATA[null@example.com (gamar)]]></author>
			<pubDate>Wed, 24 Aug 2016 10:30:40 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=1148#p1148</guid>
		</item>
	</channel>
</rss>
