Skip to content

Use try catch instead of isempty() to check if variable exists#326

Open
sameehj wants to merge 1 commit intoplotly:masterfrom
sameehj:issue_280
Open

Use try catch instead of isempty() to check if variable exists#326
sameehj wants to merge 1 commit intoplotly:masterfrom
sameehj:issue_280

Conversation

@sameehj
Copy link

@sameehj sameehj commented Aug 8, 2021

If DisplayName doesn't exist for some reason we might get the following
error [0].

Simply use try catch to store the name.

[0] - Unrecongnized field name "DisplayName".

Signed-off-by: Sameeh Jubran sameehj.@gmail.com

If DisplayName doesn't exist for some reason we might get the following
error [0].

Simply use try catch to store the name.

[0] - Unrecongnized field name "DisplayName".

Signed-off-by: Sameeh Jubran <sameehj.@gmail.com>
Copy link
Contributor

@harshpurwar harshpurwar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good for me. I think a lot more files will need similar changes. All of us need to keep this in mind and change it when we come across such an if-else statement to try-catch.

@gilbertogalvis
Copy link
Contributor

Hi @sameehj! This PR fix the issue #280?

I fixed that issue 2 days ago.

Can you please clarify us what issue is fixed with this PR? Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants