Skip to content

Commit 89954cf

Browse files
committedMar 27, 2024·
correct logic to fix build warning and get correct behavior
1 parent 8b8837e commit 89954cf

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed
 

‎src/product.cc

+2-2
Original file line numberDiff line numberDiff line change
@@ -78,14 +78,14 @@ int Product::package_id() {
7878
}
7979

8080
void Product::ChangePackageId(int new_package_id) {
81-
if (ctx_ != NULL) {
81+
if (ctx_ == NULL) {
8282
throw ValueError("Package Id cannot be changed with NULL context");
8383
}
8484
if (new_package_id == package_id_) {
8585
// no change needed
8686
return;
8787
}
88-
else if (new_package_id == Package::unpackaged_id()) {
88+
else if (new_package_id == Package::unpackaged_id()) {
8989
// unpackaged has functionally no restrictions
9090
package_id_ = new_package_id;
9191
return;

0 commit comments

Comments
 (0)
Please sign in to comment.