forked from GitHub/gf-core
don't add_ref if the revision doesn't exist
This commit is contained in:
@@ -638,8 +638,10 @@ PgfRevision pgf_checkout_revision(PgfDB *db, PgfText *name,
|
|||||||
PGF_API_BEGIN {
|
PGF_API_BEGIN {
|
||||||
DB_scope scope(db, WRITER_SCOPE);
|
DB_scope scope(db, WRITER_SCOPE);
|
||||||
ref<PgfPGF> pgf = PgfDB::get_revision(name);
|
ref<PgfPGF> pgf = PgfDB::get_revision(name);
|
||||||
Node<PgfPGF>::add_value_ref(pgf);
|
if (pgf != 0) {
|
||||||
db->ref_count++;
|
Node<PgfPGF>::add_value_ref(pgf);
|
||||||
|
db->ref_count++;
|
||||||
|
}
|
||||||
return pgf.as_object();
|
return pgf.as_object();
|
||||||
} PGF_API_END
|
} PGF_API_END
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user