VirtualBox

Changeset 97598 in vbox for trunk/src/VBox/Main


Ignore:
Timestamp:
Nov 17, 2022 4:43:04 PM (2 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
154640
Message:

Main/SnapshotImpl: Check if a given (current) snapshot object is valid, or bail out if not.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/src-server/SnapshotImpl.cpp

    r96888 r97598  
    22312231    if (FAILED(rc))
    22322232        return rc;
     2233
     2234    /* We need to explicitly check if the given snapshot is valid and bail out if not. */
     2235    if (aSnapshot.isNull())
     2236    {
     2237        if (aSnapshot == mData->mCurrentSnapshot)
     2238            return setError(VBOX_E_OBJECT_NOT_FOUND,
     2239                            tr("This VM does not have any current snapshot"));
     2240
     2241        return setError(E_INVALIDARG, tr("The given snapshot is invalid"));
     2242    }
    22332243
    22342244    ISnapshot* iSnapshot = aSnapshot;
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette