Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ImageAdmin: Fix null pointer redundant check #502

Merged

Conversation

ma8ma
Copy link
Collaborator

@ma8ma ma8ma commented Oct 31, 2020

ヌルポインタをデリファレンスする可能性があるとcppcheck 2.1に指摘されたため条件文を修正します。

cppcheckのレポート

src/image/imageadmin.cpp:660:13: warning: Either the condition 'if(view)' is redundant or there is possible null pointer dereference: view. [nullPointerRedundantCheck]
        if( view->get_url() == url ) break;
            ^
src/image/imageadmin.cpp:661:11: note: Assuming that condition 'if(view)' is not redundant
        if( view ) {
          ^
src/image/imageadmin.cpp:660:13: note: Null pointer dereference
        if( view->get_url() == url ) break;
            ^

ヌルポインタをデリファレンスする可能性があるとcppcheck 2.1に
指摘されたため条件文を修正します。

cppcheckのレポート
```
src/image/imageadmin.cpp:660:13: warning: Either the condition 'if(view)' is redundant or there is possible null pointer dereference: view. [nullPointerRedundantCheck]
        if( view->get_url() == url ) break;
            ^
src/image/imageadmin.cpp:661:11: note: Assuming that condition 'if(view)' is not redundant
        if( view ) {
          ^
src/image/imageadmin.cpp:660:13: note: Null pointer dereference
        if( view->get_url() == url ) break;
            ^
```
@ma8ma ma8ma added the bug バグの追跡 label Oct 31, 2020
@ma8ma ma8ma added this to In progress in State of JDim-v0.4.0+ via automation Oct 31, 2020
@ma8ma ma8ma merged commit 2b77fbd into JDimproved:master Oct 31, 2020
State of JDim-v0.4.0+ automation moved this from In progress to Done Oct 31, 2020
@ma8ma ma8ma deleted the imageadmin-fix-nullptr-redundant-check branch October 31, 2020 07:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug バグの追跡
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

None yet

1 participant