Skip to content

Commit a60315b

Browse files
fix: null reference error fix
1 parent d983013 commit a60315b

File tree

3 files changed

+24
-15
lines changed

3 files changed

+24
-15
lines changed

sample/Assets/Scenes/Passport/SelectAuthMethod.unity

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ MonoBehaviour:
207207
m_HandleRect: {fileID: 416242724}
208208
m_Direction: 0
209209
m_Value: 1
210-
m_Size: 1
210+
m_Size: 0.99999994
211211
m_NumberOfSteps: 0
212212
m_OnValueChanged:
213213
m_PersistentCalls:
@@ -1717,8 +1717,8 @@ RectTransform:
17171717
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
17181718
m_AnchorMin: {x: 0, y: 0}
17191719
m_AnchorMax: {x: 0, y: 0}
1720-
m_AnchoredPosition: {x: 797.1642, y: 0}
1721-
m_SizeDelta: {x: 1554.3284, y: 0}
1720+
m_AnchoredPosition: {x: 841.85657, y: 0}
1721+
m_SizeDelta: {x: 1643.7131, y: 0}
17221722
m_Pivot: {x: 0.5, y: 0.5}
17231723
--- !u!114 &1661390145
17241724
MonoBehaviour:
@@ -1812,8 +1812,8 @@ RectTransform:
18121812
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
18131813
m_AnchorMin: {x: 0, y: 0}
18141814
m_AnchorMax: {x: 0, y: 0}
1815-
m_AnchoredPosition: {x: 797.1642, y: 0}
1816-
m_SizeDelta: {x: 1554.3284, y: 0}
1815+
m_AnchoredPosition: {x: 841.85657, y: 0}
1816+
m_SizeDelta: {x: 1643.7131, y: 0}
18171817
m_Pivot: {x: 0.5, y: 0.5}
18181818
--- !u!114 &1688502349
18191819
MonoBehaviour:

sample/Assets/Scripts/Passport/GetUserInfo/GetUserInfoScript.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,13 +117,11 @@ private async UniTaskVoid GetIdTokenAsync()
117117
/// </summary>
118118
public void GetLinkedAddresses()
119119
{
120-
Debug.Log("E2E TEST DEBUG: GetLinkedAddresses() called (public method)");
121120
GetLinkedAddressesAsync();
122121
}
123122

124123
private async UniTaskVoid GetLinkedAddressesAsync()
125124
{
126-
Debug.Log("E2E TEST DEBUG: GetLinkedAddressesAsync() started");
127125
if (Passport.Instance == null)
128126
{
129127
ShowOutput("Passport instance is null");

sample/Assets/Scripts/Passport/ZkEvm/ZkEvmSendTransaction/ZkEvmSendTransactionScript.cs

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,15 @@ void Start()
2323
ShowOutput("Passport instance is null");
2424
return;
2525
}
26-
ConfirmToggle.onValueChanged.AddListener(delegate
26+
27+
// Make sure UI elements are initialized
28+
if (ConfirmToggle != null && GetTransactionReceiptToggle != null)
2729
{
28-
GetTransactionReceiptToggle.gameObject.SetActive(!ConfirmToggle.isOn);
29-
});
30+
ConfirmToggle.onValueChanged.AddListener(delegate
31+
{
32+
GetTransactionReceiptToggle.gameObject.SetActive(!ConfirmToggle.isOn);
33+
});
34+
}
3035
}
3136

3237
public void SendTransaction()
@@ -57,19 +62,21 @@ private async UniTaskVoid SendTransactionAsync()
5762
{
5863
TransactionRequest request = new TransactionRequest
5964
{
60-
to = ToInputField.text,
61-
value = ValueInputField.text,
62-
data = DataInputField.text
65+
to = ToInputField != null ? ToInputField.text : "",
66+
value = ValueInputField != null ? ValueInputField.text : "",
67+
data = DataInputField != null ? DataInputField.text : ""
6368
};
64-
if (ConfirmToggle.isOn)
69+
70+
if (ConfirmToggle != null && ConfirmToggle.isOn)
6571
{
6672
TransactionReceiptResponse response = await SampleAppManager.PassportInstance.ZkEvmSendTransactionWithConfirmation(request);
6773
ShowOutput($"Transaction hash: {response.transactionHash}\nStatus: {GetTransactionStatusString(response.status)}");
6874
}
6975
else
7076
{
7177
string transactionHash = await SampleAppManager.PassportInstance.ZkEvmSendTransaction(request);
72-
if (GetTransactionReceiptToggle.isOn)
78+
79+
if (GetTransactionReceiptToggle != null && GetTransactionReceiptToggle.isOn)
7380
{
7481
string? status = await PollStatus(transactionHash);
7582
ShowOutput($"Transaction hash: {transactionHash}\nStatus: {GetTransactionStatusString(status)}");
@@ -138,5 +145,9 @@ private void ShowOutput(string message)
138145
{
139146
Output.text = message;
140147
}
148+
else
149+
{
150+
Debug.Log($"ZkEvmSendTransactionScript: {message}");
151+
}
141152
}
142153
}

0 commit comments

Comments
 (0)